Pinterest REST API

AdAccounts

adAccount/analytics

Get ad account analytics

Get analytics for the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time.


/ad_accounts/{ad_account_id}/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/analytics?start_date=2013-10-20&end_date=2013-10-20&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[AdAccountAnalyticsResponse_inner] result = apiInstance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdAccountsApi#adAccount/analytics"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { final result = await api_instance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); print(result); } catch (e) { print('Exception when calling DefaultApi->adAccount/analytics: $e\n'); }
import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[AdAccountAnalyticsResponse_inner] result = apiInstance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdAccountsApi#adAccount/analytics"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) // Get ad account analytics [apiInstance adAccount/analyticsWith:adAccountId startDate:startDate endDate:endDate columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime completionHandler: ^(array[AdAccountAnalyticsResponse_inner] output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccount/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try { // Get ad account analytics array[AdAccountAnalyticsResponse_inner] result = apiInstance.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdAccountsApi.adAccount/analytics: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { $result = $api_instance->adAccount/analytics($adAccountId, $startDate, $endDate, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdAccountsApi->adAccount/analytics: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. eval { my $result = $api_instance->adAccount/analytics(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime); print Dumper($result); }; if ($@) { warn "Exception when calling AdAccountsApi->adAccount/analytics: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
columns =  # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try: # Get ad account analytics api_response = api_instance.ad_account/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime) pprint(api_response) except ApiException as e: print("Exception when calling AdAccountsApi->adAccount/analytics: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String

    let mut context = AdAccountsApi::Context::default();
    let result = client.adAccount/analytics(adAccountId, startDate, endDate, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.

Responses


adAccountTargetingAnalytics/get

Get targeting analytics for an ad account

Get targeting analytics for an ad account. For the requested account and metrics, the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. "age_bucket") for applicable values (e.g. "45-49"). <p/> - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/targeting_analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/targeting_analytics?start_date=2013-10-20&end_date=2013-10-20&targeting_types=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION&attribution_types="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.adAccountTargetingAnalytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdAccountsApi#adAccountTargetingAnalytics/get"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[AdsAnalyticsTargetingType] targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. final ConversionReportAttributionType attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report try { final result = await api_instance.adAccountTargetingAnalytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); print(result); } catch (e) { print('Exception when calling DefaultApi->adAccountTargetingAnalytics/get: $e\n'); }
import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.adAccountTargetingAnalytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdAccountsApi#adAccountTargetingAnalytics/get"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[AdsAnalyticsTargetingType] *targetingTypes = ; // Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) ConversionReportAttributionType *attributionTypes = ; // List of types of attribution for the conversion report (optional) (default to null) // Get targeting analytics for an ad account [apiInstance adAccountTargetingAnalytics/getWith:adAccountId startDate:startDate endDate:endDate targetingTypes:targetingTypes columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime attributionTypes:attributionTypes completionHandler: ^(MetricsResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var targetingTypes = ; // {array[AdsAnalyticsTargetingType]} Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION, // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. 'attributionTypes': // {ConversionReportAttributionType} List of types of attribution for the conversion report }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.adAccountTargetingAnalytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountTargetingAnalytics/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) var attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try { // Get targeting analytics for an ad account MetricsResponse result = apiInstance.adAccountTargetingAnalytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdAccountsApi.adAccountTargetingAnalytics/get: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. $columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. $attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { $result = $api_instance->adAccountTargetingAnalytics/get($adAccountId, $startDate, $endDate, $targetingTypes, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime, $attributionTypes); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdAccountsApi->adAccountTargetingAnalytics/get: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $targetingTypes = []; # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. my $attributionTypes = ; # ConversionReportAttributionType | List of types of attribution for the conversion report eval { my $result = $api_instance->adAccountTargetingAnalytics/get(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, targetingTypes => $targetingTypes, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime, attributionTypes => $attributionTypes); print Dumper($result); }; if ($@) { warn "Exception when calling AdAccountsApi->adAccountTargetingAnalytics/get: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
targetingTypes =  # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) columns = # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) attributionTypes = # ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try: # Get targeting analytics for an ad account api_response = api_instance.ad_account_targeting_analytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime, attributionTypes=attributionTypes) pprint(api_response) except ApiException as e: print("Exception when calling AdAccountsApi->adAccountTargetingAnalytics/get: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let targetingTypes = ; // array[AdsAnalyticsTargetingType]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String
    let attributionTypes = ; // ConversionReportAttributionType

    let mut context = AdAccountsApi::Context::default();
    let result = client.adAccountTargetingAnalytics/get(adAccountId, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
targeting_types*
array[AdsAnalyticsTargetingType]
Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
attribution_types
ConversionReportAttributionType
List of types of attribution for the conversion report

Responses


adAccounts/create

Create ad account

Create a new ad account. Different ad accounts can support different currencies, payment methods, etc. An ad account is needed to create campaigns, ad groups, and ads; other accounts (your employees or partners) can be assigned business access and appropriate roles to access an ad account. <p/> You can set up up to 50 ad accounts per user. (The user must have a business account to create an ad account.) <p/> For more, see <a class="reference external" href="https://help.pinterest.com/en/business/article/create-an-advertiser-account">Create an advertiser account</a>.


/ad_accounts

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts" \
 -d '{
  "country" : "US",
  "owner_user_id" : "383791336903426391",
  "name" : "ACME Tools"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        AdAccountCreateRequest adAccountCreateRequest = ; // AdAccountCreateRequest | 

        try {
            AdAccount result = apiInstance.adAccounts/create(adAccountCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#adAccounts/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final AdAccountCreateRequest adAccountCreateRequest = new AdAccountCreateRequest(); // AdAccountCreateRequest | 

try {
    final result = await api_instance.adAccounts/create(adAccountCreateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccounts/create: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        AdAccountCreateRequest adAccountCreateRequest = ; // AdAccountCreateRequest | 

        try {
            AdAccount result = apiInstance.adAccounts/create(adAccountCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#adAccounts/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
AdAccountCreateRequest *adAccountCreateRequest = ; // 

// Create ad account
[apiInstance adAccounts/createWith:adAccountCreateRequest
              completionHandler: ^(AdAccount output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountCreateRequest = ; // {AdAccountCreateRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccounts/create(adAccountCreateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccounts/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountCreateRequest = new AdAccountCreateRequest(); // AdAccountCreateRequest | 

            try {
                // Create ad account
                AdAccount result = apiInstance.adAccounts/create(adAccountCreateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.adAccounts/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountCreateRequest = ; // AdAccountCreateRequest | 

try {
    $result = $api_instance->adAccounts/create($adAccountCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->adAccounts/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountCreateRequest = WWW::OPenAPIClient::Object::AdAccountCreateRequest->new(); # AdAccountCreateRequest | 

eval {
    my $result = $api_instance->adAccounts/create(adAccountCreateRequest => $adAccountCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->adAccounts/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountCreateRequest =  # AdAccountCreateRequest | 

try:
    # Create ad account
    api_response = api_instance.ad_accounts/create(adAccountCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->adAccounts/create: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountCreateRequest = ; // AdAccountCreateRequest

    let mut context = AdAccountsApi::Context::default();
    let result = client.adAccounts/create(adAccountCreateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Body parameters
Name Description
adAccountCreateRequest *

Ad account to create.

Responses


adAccounts/get

Get ad account

Get an ad account


/ad_accounts/{ad_account_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            AdAccount result = apiInstance.adAccounts/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#adAccounts/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.adAccounts/get(adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccounts/get: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            AdAccount result = apiInstance.adAccounts/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#adAccounts/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)

// Get ad account
[apiInstance adAccounts/getWith:adAccountId
              completionHandler: ^(AdAccount output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccounts/get(adAccountId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccounts/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)

            try {
                // Get ad account
                AdAccount result = apiInstance.adAccounts/get(adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.adAccounts/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->adAccounts/get($adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->adAccounts/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->adAccounts/get(adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->adAccounts/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)

try:
    # Get ad account
    api_response = api_instance.ad_accounts/get(adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->adAccounts/get: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String

    let mut context = AdAccountsApi::Context::default();
    let result = client.adAccounts/get(adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required

Responses


adAccounts/list

List ad accounts

Get a list of the ad_accounts that the "operation user_account" has access to. - This includes ad_accounts they own and ad_accounts that are owned by others who have granted them <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>.


/ad_accounts

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts?bookmark=bookmark_example&page_size=56&include_shared_accounts=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        Boolean includeSharedAccounts = true; // Boolean | Include shared ad accounts

        try {
            ad_accounts_list_200_response result = apiInstance.adAccounts/list(bookmark, pageSize, includeSharedAccounts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#adAccounts/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final Boolean includeSharedAccounts = new Boolean(); // Boolean | Include shared ad accounts

try {
    final result = await api_instance.adAccounts/list(bookmark, pageSize, includeSharedAccounts);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccounts/list: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        Boolean includeSharedAccounts = true; // Boolean | Include shared ad accounts

        try {
            ad_accounts_list_200_response result = apiInstance.adAccounts/list(bookmark, pageSize, includeSharedAccounts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#adAccounts/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
Boolean *includeSharedAccounts = true; // Include shared ad accounts (optional) (default to true)

// List ad accounts
[apiInstance adAccounts/listWith:bookmark
    pageSize:pageSize
    includeSharedAccounts:includeSharedAccounts
              completionHandler: ^(ad_accounts_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'includeSharedAccounts': true // {Boolean} Include shared ad accounts
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccounts/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccounts/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var includeSharedAccounts = true;  // Boolean | Include shared ad accounts (optional)  (default to true)

            try {
                // List ad accounts
                ad_accounts_list_200_response result = apiInstance.adAccounts/list(bookmark, pageSize, includeSharedAccounts);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.adAccounts/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$includeSharedAccounts = true; // Boolean | Include shared ad accounts

try {
    $result = $api_instance->adAccounts/list($bookmark, $pageSize, $includeSharedAccounts);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->adAccounts/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $includeSharedAccounts = true; # Boolean | Include shared ad accounts

eval {
    my $result = $api_instance->adAccounts/list(bookmark => $bookmark, pageSize => $pageSize, includeSharedAccounts => $includeSharedAccounts);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->adAccounts/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
includeSharedAccounts = true # Boolean | Include shared ad accounts (optional) (default to true)

try:
    # List ad accounts
    api_response = api_instance.ad_accounts/list(bookmark=bookmark, pageSize=pageSize, includeSharedAccounts=includeSharedAccounts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->adAccounts/list: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let includeSharedAccounts = true; // Boolean

    let mut context = AdAccountsApi::Context::default();
    let result = client.adAccounts/list(bookmark, pageSize, includeSharedAccounts, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
include_shared_accounts
Boolean
Include shared ad accounts

Responses


analytics/createMmmReport

Create a request for a Marketing Mix Modeling (MMM) report

This creates an asynchronous mmm report based on the given request. It returns a token that you can use to download the report when it is ready. NOTE: An additional limit of 5 queries per minute per advertiser applies to this endpoint while it's in beta release.


/ad_accounts/{ad_account_id}/mmm_reports

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/mmm_reports" \
 -d '{
  "end_date" : "2020-12-20",
  "level" : "CAMPAIGN_TARGETING",
  "granularity" : "DAY",
  "columns" : [ "SPEND_IN_DOLLAR", "SPEND_IN_DOLLAR" ],
  "report_name" : "report_name",
  "targeting_types" : [ "GENDER" ],
  "start_date" : "2020-12-20"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        CreateMMMReportRequest createMMMReportRequest = ; // CreateMMMReportRequest | 

        try {
            CreateMMMReportResponse result = apiInstance.analytics/createMmmReport(adAccountId, createMMMReportRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/createMmmReport");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final CreateMMMReportRequest createMMMReportRequest = new CreateMMMReportRequest(); // CreateMMMReportRequest | 

try {
    final result = await api_instance.analytics/createMmmReport(adAccountId, createMMMReportRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->analytics/createMmmReport: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        CreateMMMReportRequest createMMMReportRequest = ; // CreateMMMReportRequest | 

        try {
            CreateMMMReportResponse result = apiInstance.analytics/createMmmReport(adAccountId, createMMMReportRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/createMmmReport");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
CreateMMMReportRequest *createMMMReportRequest = ; // 

// Create a request for a Marketing Mix Modeling (MMM) report
[apiInstance analytics/createMmmReportWith:adAccountId
    createMMMReportRequest:createMMMReportRequest
              completionHandler: ^(CreateMMMReportResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var createMMMReportRequest = ; // {CreateMMMReportRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.analytics/createMmmReport(adAccountId, createMMMReportRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class analytics/createMmmReportExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var createMMMReportRequest = new CreateMMMReportRequest(); // CreateMMMReportRequest | 

            try {
                // Create a request for a Marketing Mix Modeling (MMM) report
                CreateMMMReportResponse result = apiInstance.analytics/createMmmReport(adAccountId, createMMMReportRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.analytics/createMmmReport: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$createMMMReportRequest = ; // CreateMMMReportRequest | 

try {
    $result = $api_instance->analytics/createMmmReport($adAccountId, $createMMMReportRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->analytics/createMmmReport: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $createMMMReportRequest = WWW::OPenAPIClient::Object::CreateMMMReportRequest->new(); # CreateMMMReportRequest | 

eval {
    my $result = $api_instance->analytics/createMmmReport(adAccountId => $adAccountId, createMMMReportRequest => $createMMMReportRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->analytics/createMmmReport: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
createMMMReportRequest =  # CreateMMMReportRequest | 

try:
    # Create a request for a Marketing Mix Modeling (MMM) report
    api_response = api_instance.analytics/create_mmm_report(adAccountId, createMMMReportRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->analytics/createMmmReport: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let createMMMReportRequest = ; // CreateMMMReportRequest

    let mut context = AdAccountsApi::Context::default();
    let result = client.analytics/createMmmReport(adAccountId, createMMMReportRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
createMMMReportRequest *

Responses


analytics/createReport

Create async request for an account analytics report

This returns a token that you can use to download the report when it is ready. Note that this endpoint requires the parameters to be passed as JSON-formatted in the request body. This endpoint does not support URL query parameters. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 914 days before the current date in UTC time and the max time range supported is 186 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days. - If level is PRODUCT_ITEM, the furthest back you can are allowed to pull data is 92 days before the current date in UTC time and the max time range supported is 31 days. - If level is PRODUCT_ITEM, ad_ids and ad_statuses parameters are not allowed. Any columns related to pin promotion and ad is not allowed either.


/ad_accounts/{ad_account_id}/reports

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/reports" \
 -d '{
  "end_date" : "2020-12-20",
  "attribution_types" : [ "INDIVIDUAL", "INDIVIDUAL" ],
  "view_window_days" : 1,
  "level" : "CAMPAIGN",
  "report_format" : "JSON",
  "granularity" : "granularity",
  "columns" : [ "SPEND_IN_MICRO_DOLLAR", "SPEND_IN_MICRO_DOLLAR" ],
  "click_window_days" : 0,
  "conversion_report_time" : "TIME_OF_AD_ACTION",
  "engagement_window_days" : 6,
  "start_date" : "2020-12-20"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdsAnalyticsCreateAsyncRequest adsAnalyticsCreateAsyncRequest = ; // AdsAnalyticsCreateAsyncRequest | 

        try {
            AdsAnalyticsCreateAsyncResponse result = apiInstance.analytics/createReport(adAccountId, adsAnalyticsCreateAsyncRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/createReport");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AdsAnalyticsCreateAsyncRequest adsAnalyticsCreateAsyncRequest = new AdsAnalyticsCreateAsyncRequest(); // AdsAnalyticsCreateAsyncRequest | 

try {
    final result = await api_instance.analytics/createReport(adAccountId, adsAnalyticsCreateAsyncRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->analytics/createReport: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdsAnalyticsCreateAsyncRequest adsAnalyticsCreateAsyncRequest = ; // AdsAnalyticsCreateAsyncRequest | 

        try {
            AdsAnalyticsCreateAsyncResponse result = apiInstance.analytics/createReport(adAccountId, adsAnalyticsCreateAsyncRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/createReport");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AdsAnalyticsCreateAsyncRequest *adsAnalyticsCreateAsyncRequest = ; // 

// Create async request for an account analytics report
[apiInstance analytics/createReportWith:adAccountId
    adsAnalyticsCreateAsyncRequest:adsAnalyticsCreateAsyncRequest
              completionHandler: ^(AdsAnalyticsCreateAsyncResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adsAnalyticsCreateAsyncRequest = ; // {AdsAnalyticsCreateAsyncRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.analytics/createReport(adAccountId, adsAnalyticsCreateAsyncRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class analytics/createReportExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adsAnalyticsCreateAsyncRequest = new AdsAnalyticsCreateAsyncRequest(); // AdsAnalyticsCreateAsyncRequest | 

            try {
                // Create async request for an account analytics report
                AdsAnalyticsCreateAsyncResponse result = apiInstance.analytics/createReport(adAccountId, adsAnalyticsCreateAsyncRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.analytics/createReport: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adsAnalyticsCreateAsyncRequest = ; // AdsAnalyticsCreateAsyncRequest | 

try {
    $result = $api_instance->analytics/createReport($adAccountId, $adsAnalyticsCreateAsyncRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->analytics/createReport: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adsAnalyticsCreateAsyncRequest = WWW::OPenAPIClient::Object::AdsAnalyticsCreateAsyncRequest->new(); # AdsAnalyticsCreateAsyncRequest | 

eval {
    my $result = $api_instance->analytics/createReport(adAccountId => $adAccountId, adsAnalyticsCreateAsyncRequest => $adsAnalyticsCreateAsyncRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->analytics/createReport: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adsAnalyticsCreateAsyncRequest =  # AdsAnalyticsCreateAsyncRequest | 

try:
    # Create async request for an account analytics report
    api_response = api_instance.analytics/create_report(adAccountId, adsAnalyticsCreateAsyncRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->analytics/createReport: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adsAnalyticsCreateAsyncRequest = ; // AdsAnalyticsCreateAsyncRequest

    let mut context = AdAccountsApi::Context::default();
    let result = client.analytics/createReport(adAccountId, adsAnalyticsCreateAsyncRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adsAnalyticsCreateAsyncRequest *

Responses


analytics/createTemplateReport

Create async request for an analytics report using a template

This takes a template ID and an optional custom timeframe and constructs an asynchronous report based on the template. It returns a token that you can use to download the report when it is ready.


/ad_accounts/{ad_account_id}/templates/{template_id}/reports

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/templates/{template_id}/reports?start_date=2013-10-20&end_date=2013-10-20&granularity=DAY"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String templateId = templateId_example; // String | Unique identifier of a template.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
        Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly try { AdsAnalyticsCreateAsyncResponse result = apiInstance.analytics/createTemplateReport(adAccountId, templateId, startDate, endDate, granularity); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdAccountsApi#analytics/createTemplateReport"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String templateId = new String(); // String | Unique identifier of a template.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly try { final result = await api_instance.analytics/createTemplateReport(adAccountId, templateId, startDate, endDate, granularity); print(result); } catch (e) { print('Exception when calling DefaultApi->analytics/createTemplateReport: $e\n'); }
import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String templateId = templateId_example; // String | Unique identifier of a template.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
        Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly try { AdsAnalyticsCreateAsyncResponse result = apiInstance.analytics/createTemplateReport(adAccountId, templateId, startDate, endDate, granularity); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdAccountsApi#analytics/createTemplateReport"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *templateId = templateId_example; // Unique identifier of a template. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today. (optional) (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date. (optional) (default to null)
Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (optional) (default to null) // Create async request for an analytics report using a template [apiInstance analytics/createTemplateReportWith:adAccountId templateId:templateId startDate:startDate endDate:endDate granularity:granularity completionHandler: ^(AdsAnalyticsCreateAsyncResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var templateId = templateId_example; // {String} Unique identifier of a template.
var opts = {
  'startDate': 2013-10-20, // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
  'endDate': 2013-10-20, // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
  'granularity': DAY // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.analytics/createTemplateReport(adAccountId, templateId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class analytics/createTemplateReportExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var templateId = templateId_example;  // String | Unique identifier of a template. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today. (optional)  (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date. (optional)  (default to null)
            var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (optional) (default to null) try { // Create async request for an analytics report using a template AdsAnalyticsCreateAsyncResponse result = apiInstance.analytics/createTemplateReport(adAccountId, templateId, startDate, endDate, granularity); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdAccountsApi.analytics/createTemplateReport: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$templateId = templateId_example; // String | Unique identifier of a template.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
$granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly try { $result = $api_instance->analytics/createTemplateReport($adAccountId, $templateId, $startDate, $endDate, $granularity); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdAccountsApi->analytics/createTemplateReport: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $templateId = templateId_example; # String | Unique identifier of a template.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly eval { my $result = $api_instance->analytics/createTemplateReport(adAccountId => $adAccountId, templateId => $templateId, startDate => $startDate, endDate => $endDate, granularity => $granularity); print Dumper($result); }; if ($@) { warn "Exception when calling AdAccountsApi->analytics/createTemplateReport: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
templateId = templateId_example # String | Unique identifier of a template. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today. (optional) (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date. (optional) (default to null)
granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (optional) (default to null) try: # Create async request for an analytics report using a template api_response = api_instance.analytics/create_template_report(adAccountId, templateId, startDate=startDate, endDate=endDate, granularity=granularity) pprint(api_response) except ApiException as e: print("Exception when calling AdAccountsApi->analytics/createTemplateReport: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let templateId = templateId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let granularity = DAY; // Granularity

    let mut context = AdAccountsApi::Context::default();
    let result = client.analytics/createTemplateReport(adAccountId, templateId, startDate, endDate, granularity, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
template_id*
String
Unique identifier of a template.
Required
Query parameters
Name Description
start_date
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years back from today.
end_date
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 2.5 years past start date.
granularity
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly

Responses


analytics/getMmmReport

Get advertiser Marketing Mix Modeling (MMM) report.

Get an mmm report for an ad account. This returns a URL to an mmm metrics report given a token returned from the create mmm report endpoint.


/ad_accounts/{ad_account_id}/mmm_reports

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/mmm_reports?token=token_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String token = token_example; // String | Token returned from the post request creation call

        try {
            GetMMMReportResponse result = apiInstance.analytics/getMmmReport(adAccountId, token);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/getMmmReport");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String token = new String(); // String | Token returned from the post request creation call

try {
    final result = await api_instance.analytics/getMmmReport(adAccountId, token);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->analytics/getMmmReport: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String token = token_example; // String | Token returned from the post request creation call

        try {
            GetMMMReportResponse result = apiInstance.analytics/getMmmReport(adAccountId, token);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/getMmmReport");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *token = token_example; // Token returned from the post request creation call (default to null)

// Get advertiser Marketing Mix Modeling (MMM) report.
[apiInstance analytics/getMmmReportWith:adAccountId
    token:token
              completionHandler: ^(GetMMMReportResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var token = token_example; // {String} Token returned from the post request creation call

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.analytics/getMmmReport(adAccountId, token, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class analytics/getMmmReportExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var token = token_example;  // String | Token returned from the post request creation call (default to null)

            try {
                // Get advertiser Marketing Mix Modeling (MMM) report.
                GetMMMReportResponse result = apiInstance.analytics/getMmmReport(adAccountId, token);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.analytics/getMmmReport: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$token = token_example; // String | Token returned from the post request creation call

try {
    $result = $api_instance->analytics/getMmmReport($adAccountId, $token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->analytics/getMmmReport: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $token = token_example; # String | Token returned from the post request creation call

eval {
    my $result = $api_instance->analytics/getMmmReport(adAccountId => $adAccountId, token => $token);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->analytics/getMmmReport: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
token = token_example # String | Token returned from the post request creation call (default to null)

try:
    # Get advertiser Marketing Mix Modeling (MMM) report.
    api_response = api_instance.analytics/get_mmm_report(adAccountId, token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->analytics/getMmmReport: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let token = token_example; // String

    let mut context = AdAccountsApi::Context::default();
    let result = client.analytics/getMmmReport(adAccountId, token, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
token*
String
Token returned from the post request creation call
Required

Responses


analytics/getReport

Get the account analytics report created by the async call

This returns a URL to an analytics report given a token returned from the post request report creation call. You can use the URL to download the report. The link is valid for five minutes and the report is valid for one hour. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager.


/ad_accounts/{ad_account_id}/reports

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/reports?token=token_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String token = token_example; // String | Token returned from the post request creation call

        try {
            AdsAnalyticsGetAsyncResponse result = apiInstance.analytics/getReport(adAccountId, token);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/getReport");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String token = new String(); // String | Token returned from the post request creation call

try {
    final result = await api_instance.analytics/getReport(adAccountId, token);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->analytics/getReport: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String token = token_example; // String | Token returned from the post request creation call

        try {
            AdsAnalyticsGetAsyncResponse result = apiInstance.analytics/getReport(adAccountId, token);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#analytics/getReport");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *token = token_example; // Token returned from the post request creation call (default to null)

// Get the account analytics report created by the async call
[apiInstance analytics/getReportWith:adAccountId
    token:token
              completionHandler: ^(AdsAnalyticsGetAsyncResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var token = token_example; // {String} Token returned from the post request creation call

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.analytics/getReport(adAccountId, token, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class analytics/getReportExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var token = token_example;  // String | Token returned from the post request creation call (default to null)

            try {
                // Get the account analytics report created by the async call
                AdsAnalyticsGetAsyncResponse result = apiInstance.analytics/getReport(adAccountId, token);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.analytics/getReport: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$token = token_example; // String | Token returned from the post request creation call

try {
    $result = $api_instance->analytics/getReport($adAccountId, $token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->analytics/getReport: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $token = token_example; # String | Token returned from the post request creation call

eval {
    my $result = $api_instance->analytics/getReport(adAccountId => $adAccountId, token => $token);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->analytics/getReport: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
token = token_example # String | Token returned from the post request creation call (default to null)

try:
    # Get the account analytics report created by the async call
    api_response = api_instance.analytics/get_report(adAccountId, token)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->analytics/getReport: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let token = token_example; // String

    let mut context = AdAccountsApi::Context::default();
    let result = client.analytics/getReport(adAccountId, token, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
token*
String
Token returned from the post request creation call
Required

Responses


sandbox/delete

Delete ads data for ad account in API Sandbox

Delete an ad account and all the ads data associated with that account. A string message is returned indicating the status of the delete operation. Note: This endpoint is only allowed in the Pinterest API Sandbox (https://api-sandbox.pinterest.com/v5). Go to https://developers.pinterest.com/docs/dev-tools/sandbox/ for more information.


/ad_accounts/{ad_account_id}/sandbox

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/sandbox"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            'String' result = apiInstance.sandbox/delete(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#sandbox/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.sandbox/delete(adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->sandbox/delete: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            'String' result = apiInstance.sandbox/delete(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#sandbox/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)

// Delete ads data for ad account in API Sandbox
[apiInstance sandbox/deleteWith:adAccountId
              completionHandler: ^('String' output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.sandbox/delete(adAccountId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class sandbox/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)

            try {
                // Delete ads data for ad account in API Sandbox
                'String' result = apiInstance.sandbox/delete(adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.sandbox/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->sandbox/delete($adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->sandbox/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->sandbox/delete(adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->sandbox/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)

try:
    # Delete ads data for ad account in API Sandbox
    api_response = api_instance.sandbox/delete(adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->sandbox/delete: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String

    let mut context = AdAccountsApi::Context::default();
    let result = client.sandbox/delete(adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required

Responses


templates/list

List templates

Gets all Templates associated with an ad account ID.


/ad_accounts/{ad_account_id}/templates

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/templates?page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdAccountsApi;

import java.io.File;
import java.util.*;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            templates_list_200_response result = apiInstance.templates/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#templates/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.templates/list(adAccountId, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->templates/list: $e\n');
}

import org.openapitools.client.api.AdAccountsApi;

public class AdAccountsApiExample {
    public static void main(String[] args) {
        AdAccountsApi apiInstance = new AdAccountsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            templates_list_200_response result = apiInstance.templates/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdAccountsApi#templates/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdAccountsApi *apiInstance = [[AdAccountsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// List templates
[apiInstance templates/listWith:adAccountId
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(templates_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdAccountsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.templates/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class templates/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdAccountsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // List templates
                templates_list_200_response result = apiInstance.templates/list(adAccountId, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdAccountsApi.templates/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdAccountsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->templates/list($adAccountId, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdAccountsApi->templates/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdAccountsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdAccountsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->templates/list(adAccountId => $adAccountId, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdAccountsApi->templates/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdAccountsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # List templates
    api_response = api_instance.templates/list(adAccountId, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdAccountsApi->templates/list: %s\n" % e)
extern crate AdAccountsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = AdAccountsApi::Context::default();
    let result = client.templates/list(adAccountId, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


AdGroups

adGroups/analytics

Get ad group analytics

Get analytics for the specified ad groups in the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/ad_groups/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups/analytics?start_date=2013-10-20&end_date=2013-10-20&ad_group_ids=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[AdGroupsAnalyticsResponse_inner] result = apiInstance.adGroups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdGroupsApi#adGroups/analytics"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[String] adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results.
final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { final result = await api_instance.adGroups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); print(result); } catch (e) { print('Exception when calling DefaultApi->adGroups/analytics: $e\n'); }
import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[AdGroupsAnalyticsResponse_inner] result = apiInstance.adGroups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdGroupsApi#adGroups/analytics"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[String] *adGroupIds = ; // List of Ad group Ids to use to filter the results. (default to null)
array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) // Get ad group analytics [apiInstance adGroups/analyticsWith:adAccountId startDate:startDate endDate:endDate adGroupIds:adGroupIds columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime completionHandler: ^(array[AdGroupsAnalyticsResponse_inner] output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var adGroupIds = ; // {array[String]} List of Ad group Ids to use to filter the results.
var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.adGroups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroups/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results. (default to null)
            var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try { // Get ad group analytics array[AdGroupsAnalyticsResponse_inner] result = apiInstance.adGroups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdGroupsApi.adGroups/analytics: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
$columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { $result = $api_instance->adGroups/analytics($adAccountId, $startDate, $endDate, $adGroupIds, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdGroupsApi->adGroups/analytics: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $adGroupIds = []; # array[String] | List of Ad group Ids to use to filter the results.
my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. eval { my $result = $api_instance->adGroups/analytics(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, adGroupIds => $adGroupIds, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime); print Dumper($result); }; if ($@) { warn "Exception when calling AdGroupsApi->adGroups/analytics: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
adGroupIds =  # array[String] | List of Ad group Ids to use to filter the results. (default to null)
columns =  # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try: # Get ad group analytics api_response = api_instance.ad_groups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime) pprint(api_response) except ApiException as e: print("Exception when calling AdGroupsApi->adGroups/analytics: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let adGroupIds = ; // array[String]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroups/analytics(adAccountId, startDate, endDate, adGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
ad_group_ids*
array[String]
List of Ad group Ids to use to filter the results.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.

Responses


adGroups/audienceSizing

Get audience sizing

Get potential audience size for an ad group with given targeting criteria. Potential audience size estimates the number of people you may be able to reach per month with your campaign. It is based on historical advertising data and the targeting criteria you select. It does not guarantee results or take into account factors such as bid, budget, schedule, seasonality or product experiments.


/ad_accounts/{ad_account_id}/ad_groups/audience_sizing

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups/audience_sizing" \
 -d '{
  "targeting_spec" : {
    "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
    "GEO" : [ "GEO", "GEO" ],
    "LOCATION" : [ "LOCATION", "LOCATION" ],
    "LOCALE" : [ "LOCALE", "LOCALE" ],
    "AGE_BUCKET" : [ "35-44", "50-54" ],
    "SHOPPING_RETARGETING" : [ {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    }, {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    } ],
    "GENDER" : [ "unknown", "unknown" ],
    "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
    "APPTYPE" : [ "ipad", "iphone" ],
    "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
    "INTEREST" : [ "INTEREST", "INTEREST" ]
  },
  "keywords" : [ {
    "match_type" : "BROAD",
    "value" : "value"
  }, {
    "match_type" : "BROAD",
    "value" : "value"
  } ],
  "creative_types" : [ "REGULAR", "REGULAR" ],
  "product_group_ids" : [ "23423422123", "23423422123" ],
  "auto_targeting_enabled" : true,
  "placement_group" : "ALL"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdGroupAudienceSizingRequest adGroupAudienceSizingRequest = ; // AdGroupAudienceSizingRequest | 

        try {
            AdGroupAudienceSizingResponse result = apiInstance.adGroups/audienceSizing(adAccountId, adGroupAudienceSizingRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/audienceSizing");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AdGroupAudienceSizingRequest adGroupAudienceSizingRequest = new AdGroupAudienceSizingRequest(); // AdGroupAudienceSizingRequest | 

try {
    final result = await api_instance.adGroups/audienceSizing(adAccountId, adGroupAudienceSizingRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adGroups/audienceSizing: $e\n');
}

import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdGroupAudienceSizingRequest adGroupAudienceSizingRequest = ; // AdGroupAudienceSizingRequest | 

        try {
            AdGroupAudienceSizingResponse result = apiInstance.adGroups/audienceSizing(adAccountId, adGroupAudienceSizingRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/audienceSizing");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AdGroupAudienceSizingRequest *adGroupAudienceSizingRequest = ; //  (optional)

// Get audience sizing
[apiInstance adGroups/audienceSizingWith:adAccountId
    adGroupAudienceSizingRequest:adGroupAudienceSizingRequest
              completionHandler: ^(AdGroupAudienceSizingResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'adGroupAudienceSizingRequest':  // {AdGroupAudienceSizingRequest} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adGroups/audienceSizing(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroups/audienceSizingExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adGroupAudienceSizingRequest = new AdGroupAudienceSizingRequest(); // AdGroupAudienceSizingRequest |  (optional) 

            try {
                // Get audience sizing
                AdGroupAudienceSizingResponse result = apiInstance.adGroups/audienceSizing(adAccountId, adGroupAudienceSizingRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdGroupsApi.adGroups/audienceSizing: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adGroupAudienceSizingRequest = ; // AdGroupAudienceSizingRequest | 

try {
    $result = $api_instance->adGroups/audienceSizing($adAccountId, $adGroupAudienceSizingRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdGroupsApi->adGroups/audienceSizing: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adGroupAudienceSizingRequest = WWW::OPenAPIClient::Object::AdGroupAudienceSizingRequest->new(); # AdGroupAudienceSizingRequest | 

eval {
    my $result = $api_instance->adGroups/audienceSizing(adAccountId => $adAccountId, adGroupAudienceSizingRequest => $adGroupAudienceSizingRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdGroupsApi->adGroups/audienceSizing: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adGroupAudienceSizingRequest =  # AdGroupAudienceSizingRequest |  (optional)

try:
    # Get audience sizing
    api_response = api_instance.ad_groups/audience_sizing(adAccountId, adGroupAudienceSizingRequest=adGroupAudienceSizingRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdGroupsApi->adGroups/audienceSizing: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adGroupAudienceSizingRequest = ; // AdGroupAudienceSizingRequest

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroups/audienceSizing(adAccountId, adGroupAudienceSizingRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adGroupAudienceSizingRequest

Responses


adGroups/create

Create ad groups

Create multiple new ad groups. All ads in a given ad group will have the same budget, bid, run dates, targeting, and placement (search, browse, other). For more information, <a href="https://help.pinterest.com/en/business/article/campaign-structure" target="_blank"> click here</a>.</p> <strong>Note:</strong> - 'bid_in_micro_currency' and 'budget_in_micro_currency' should be expressed in microcurrency amounts based on the currency field set in the advertiser's profile.<p/> <p>Microcurrency is used to track very small transactions, based on the currency set in the advertiser’s profile.</p> <p>A microcurrency unit is 10^(-6) of the standard unit of currency selected in the advertiser’s profile.</p> <p><strong>Equivalency equations</strong>, using dollars as an example currency:</p> <ul> <li>$1 = 1,000,000 microdollars</li> <li>1 microdollar = $0.000001 </li> </ul> <p><strong>To convert between currency and microcurrency</strong>, using dollars as an example currency:</p> <ul> <li>To convert dollars to microdollars, mutiply dollars by 1,000,000</li> <li>To convert microdollars to dollars, divide microdollars by 1,000,000</li> </ul> - Ad groups belong to ad campaigns. Some types of campaigns (e.g. budget optimization) have limits on the number of ad groups they can hold. If you exceed those limits, you will get an error message. - Start and end time cannot be set for ad groups that belong to CBO campaigns. Currently, campaigns with the following objective types: TRAFFIC, AWARENESS, WEB_CONVERSIONS, and CATALOG_SALES will default to CBO.


/ad_accounts/{ad_account_id}/ad_groups

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups" \
 -d '{
  "bid_in_micro_currency" : 5000000,
  "end_time" : 5705424000,
  "auto_targeting_enabled" : true,
  "tracking_urls" : {
    "engagement" : [ "engagement", "engagement" ],
    "audience_verification" : [ "audience_verification", "audience_verification" ],
    "impression" : [ "impression", "impression" ],
    "buyable_button" : [ "buyable_button", "buyable_button" ],
    "click" : [ "click", "click" ]
  },
  "budget_in_micro_currency" : 5000000,
  "bid_strategy_type" : "MAX_BID",
  "start_time" : 5686848000,
  "billable_event" : "CLICKTHROUGH",
  "targeting_spec" : {
    "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
    "GEO" : [ "GEO", "GEO" ],
    "LOCATION" : [ "LOCATION", "LOCATION" ],
    "LOCALE" : [ "LOCALE", "LOCALE" ],
    "AGE_BUCKET" : [ "35-44", "50-54" ],
    "SHOPPING_RETARGETING" : [ {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    }, {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    } ],
    "GENDER" : [ "unknown", "unknown" ],
    "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
    "APPTYPE" : [ "ipad", "iphone" ],
    "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
    "INTEREST" : [ "INTEREST", "INTEREST" ]
  },
  "name" : "Ad Group For Pin: 687195905986",
  "lifetime_frequency_cap" : 100,
  "optimization_goal_metadata" : {
    "frequency_goal_metadata" : {
      "timerange" : "DAY",
      "frequency" : 5
    },
    "conversion_tag_v3_goal_metadata" : {
      "attribution_windows" : {
        "view_window_days" : 1,
        "click_window_days" : 0,
        "engagement_window_days" : 6
      },
      "conversion_tag_id" : "conversion_tag_id",
      "learning_mode_type" : "ACTIVE",
      "conversion_event" : "PAGE_VISIT",
      "is_roas_optimized" : true,
      "cpa_goal_value_in_micro_currency" : "cpa_goal_value_in_micro_currency"
    },
    "scrollup_goal_metadata" : {
      "scrollup_goal_value_in_micro_currency" : "scrollup_goal_value_in_micro_currency"
    }
  },
  "placement_group" : "placement_group",
  "budget_type" : "DAILY",
  "campaign_id" : "626736533506",
  "status" : "status",
  "pacing_delivery_type" : "STANDARD"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdGroupCreateRequest] adGroupCreateRequest = ; // array[AdGroupCreateRequest] | 

        try {
            AdGroupArrayResponse result = apiInstance.adGroups/create(adAccountId, adGroupCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[AdGroupCreateRequest] adGroupCreateRequest = new array[AdGroupCreateRequest](); // array[AdGroupCreateRequest] | 

try {
    final result = await api_instance.adGroups/create(adAccountId, adGroupCreateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adGroups/create: $e\n');
}

import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdGroupCreateRequest] adGroupCreateRequest = ; // array[AdGroupCreateRequest] | 

        try {
            AdGroupArrayResponse result = apiInstance.adGroups/create(adAccountId, adGroupCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[AdGroupCreateRequest] *adGroupCreateRequest = ; // 

// Create ad groups
[apiInstance adGroups/createWith:adAccountId
    adGroupCreateRequest:adGroupCreateRequest
              completionHandler: ^(AdGroupArrayResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adGroupCreateRequest = ; // {array[AdGroupCreateRequest]} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adGroups/create(adAccountId, adGroupCreateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroups/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adGroupCreateRequest = new array[AdGroupCreateRequest](); // array[AdGroupCreateRequest] | 

            try {
                // Create ad groups
                AdGroupArrayResponse result = apiInstance.adGroups/create(adAccountId, adGroupCreateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdGroupsApi.adGroups/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adGroupCreateRequest = ; // array[AdGroupCreateRequest] | 

try {
    $result = $api_instance->adGroups/create($adAccountId, $adGroupCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdGroupsApi->adGroups/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adGroupCreateRequest = [WWW::OPenAPIClient::Object::array[AdGroupCreateRequest]->new()]; # array[AdGroupCreateRequest] | 

eval {
    my $result = $api_instance->adGroups/create(adAccountId => $adAccountId, adGroupCreateRequest => $adGroupCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdGroupsApi->adGroups/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adGroupCreateRequest =  # array[AdGroupCreateRequest] | 

try:
    # Create ad groups
    api_response = api_instance.ad_groups/create(adAccountId, adGroupCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdGroupsApi->adGroups/create: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adGroupCreateRequest = ; // array[AdGroupCreateRequest]

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroups/create(adAccountId, adGroupCreateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adGroupCreateRequest *

List of ad groups to create, size limit [1, 30].

Responses


adGroups/get

Get ad group

Get a specific ad given the ad ID. If your pin is rejected, rejected_reasons will contain additional information from the Ad Review process. For more information about our policies and rejection reasons see the <a href="https://www.pinterest.com/_/_/policy/advertising-guidelines/" target="_blank">Pinterest advertising standards</a>.


/ad_accounts/{ad_account_id}/ad_groups/{ad_group_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups/{ad_group_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String adGroupId = adGroupId_example; // String | Unique identifier of an ad group.

        try {
            AdGroupResponse result = apiInstance.adGroups/get(adAccountId, adGroupId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String adGroupId = new String(); // String | Unique identifier of an ad group.

try {
    final result = await api_instance.adGroups/get(adAccountId, adGroupId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adGroups/get: $e\n');
}

import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String adGroupId = adGroupId_example; // String | Unique identifier of an ad group.

        try {
            AdGroupResponse result = apiInstance.adGroups/get(adAccountId, adGroupId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *adGroupId = adGroupId_example; // Unique identifier of an ad group. (default to null)

// Get ad group
[apiInstance adGroups/getWith:adAccountId
    adGroupId:adGroupId
              completionHandler: ^(AdGroupResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adGroupId = adGroupId_example; // {String} Unique identifier of an ad group.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adGroups/get(adAccountId, adGroupId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroups/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adGroupId = adGroupId_example;  // String | Unique identifier of an ad group. (default to null)

            try {
                // Get ad group
                AdGroupResponse result = apiInstance.adGroups/get(adAccountId, adGroupId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdGroupsApi.adGroups/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adGroupId = adGroupId_example; // String | Unique identifier of an ad group.

try {
    $result = $api_instance->adGroups/get($adAccountId, $adGroupId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdGroupsApi->adGroups/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adGroupId = adGroupId_example; # String | Unique identifier of an ad group.

eval {
    my $result = $api_instance->adGroups/get(adAccountId => $adAccountId, adGroupId => $adGroupId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdGroupsApi->adGroups/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adGroupId = adGroupId_example # String | Unique identifier of an ad group. (default to null)

try:
    # Get ad group
    api_response = api_instance.ad_groups/get(adAccountId, adGroupId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdGroupsApi->adGroups/get: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adGroupId = adGroupId_example; // String

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroups/get(adAccountId, adGroupId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
ad_group_id*
String
Unique identifier of an ad group.
Required

Responses


adGroups/list

List ad groups

List ad groups based on provided campaign IDs or ad group IDs.(campaign_ids or ad_group_ids). <p/> <strong>Note:</strong><p/> Provide only campaign_id or ad_group_id. Do not provide both.


/ad_accounts/{ad_account_id}/ad_groups

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups?campaign_ids=&ad_group_ids=&entity_statuses=&page_size=56&order=ASCENDING&bookmark=bookmark_example&translate_interests_to_names=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        array[String] entityStatuses = ; // array[String] | Entity status
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Boolean translateInterestsToNames = true; // Boolean | Return interests as text names (if value is true) rather than topic IDs.

        try {
            ad_groups_list_200_response result = apiInstance.adGroups/list(adAccountId, campaignIds, adGroupIds, entityStatuses, pageSize, order, bookmark, translateInterestsToNames);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results.
final array[String] adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results.
final array[String] entityStatuses = new array[String](); // array[String] | Entity status
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Boolean translateInterestsToNames = new Boolean(); // Boolean | Return interests as text names (if value is true) rather than topic IDs.

try {
    final result = await api_instance.adGroups/list(adAccountId, campaignIds, adGroupIds, entityStatuses, pageSize, order, bookmark, translateInterestsToNames);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adGroups/list: $e\n');
}

import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        array[String] entityStatuses = ; // array[String] | Entity status
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Boolean translateInterestsToNames = true; // Boolean | Return interests as text names (if value is true) rather than topic IDs.

        try {
            ad_groups_list_200_response result = apiInstance.adGroups/list(adAccountId, campaignIds, adGroupIds, entityStatuses, pageSize, order, bookmark, translateInterestsToNames);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *campaignIds = ; // List of Campaign Ids to use to filter the results. (optional) (default to null)
array[String] *adGroupIds = ; // List of Ad group Ids to use to filter the results. (optional) (default to null)
array[String] *entityStatuses = ; // Entity status (optional) (default to ["ACTIVE","PAUSED"])
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Boolean *translateInterestsToNames = true; // Return interests as text names (if value is true) rather than topic IDs. (optional) (default to false)

// List ad groups
[apiInstance adGroups/listWith:adAccountId
    campaignIds:campaignIds
    adGroupIds:adGroupIds
    entityStatuses:entityStatuses
    pageSize:pageSize
    order:order
    bookmark:bookmark
    translateInterestsToNames:translateInterestsToNames
              completionHandler: ^(ad_groups_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'campaignIds': , // {array[String]} List of Campaign Ids to use to filter the results.
  'adGroupIds': , // {array[String]} List of Ad group Ids to use to filter the results.
  'entityStatuses': , // {array[String]} Entity status
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'translateInterestsToNames': true // {Boolean} Return interests as text names (if value is true) rather than topic IDs.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adGroups/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroups/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results. (optional)  (default to null)
            var adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results. (optional)  (default to null)
            var entityStatuses = new array[String](); // array[String] | Entity status (optional)  (default to ["ACTIVE","PAUSED"])
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var translateInterestsToNames = true;  // Boolean | Return interests as text names (if value is true) rather than topic IDs. (optional)  (default to false)

            try {
                // List ad groups
                ad_groups_list_200_response result = apiInstance.adGroups/list(adAccountId, campaignIds, adGroupIds, entityStatuses, pageSize, order, bookmark, translateInterestsToNames);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdGroupsApi.adGroups/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
$adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
$entityStatuses = ; // array[String] | Entity status
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$translateInterestsToNames = true; // Boolean | Return interests as text names (if value is true) rather than topic IDs.

try {
    $result = $api_instance->adGroups/list($adAccountId, $campaignIds, $adGroupIds, $entityStatuses, $pageSize, $order, $bookmark, $translateInterestsToNames);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdGroupsApi->adGroups/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignIds = []; # array[String] | List of Campaign Ids to use to filter the results.
my $adGroupIds = []; # array[String] | List of Ad group Ids to use to filter the results.
my $entityStatuses = []; # array[String] | Entity status
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $translateInterestsToNames = true; # Boolean | Return interests as text names (if value is true) rather than topic IDs.

eval {
    my $result = $api_instance->adGroups/list(adAccountId => $adAccountId, campaignIds => $campaignIds, adGroupIds => $adGroupIds, entityStatuses => $entityStatuses, pageSize => $pageSize, order => $order, bookmark => $bookmark, translateInterestsToNames => $translateInterestsToNames);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdGroupsApi->adGroups/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignIds =  # array[String] | List of Campaign Ids to use to filter the results. (optional) (default to null)
adGroupIds =  # array[String] | List of Ad group Ids to use to filter the results. (optional) (default to null)
entityStatuses =  # array[String] | Entity status (optional) (default to ["ACTIVE","PAUSED"])
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
translateInterestsToNames = true # Boolean | Return interests as text names (if value is true) rather than topic IDs. (optional) (default to false)

try:
    # List ad groups
    api_response = api_instance.ad_groups/list(adAccountId, campaignIds=campaignIds, adGroupIds=adGroupIds, entityStatuses=entityStatuses, pageSize=pageSize, order=order, bookmark=bookmark, translateInterestsToNames=translateInterestsToNames)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdGroupsApi->adGroups/list: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignIds = ; // array[String]
    let adGroupIds = ; // array[String]
    let entityStatuses = ; // array[String]
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String
    let translateInterestsToNames = true; // Boolean

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroups/list(adAccountId, campaignIds, adGroupIds, entityStatuses, pageSize, order, bookmark, translateInterestsToNames, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
campaign_ids
array[String]
List of Campaign Ids to use to filter the results.
ad_group_ids
array[String]
List of Ad group Ids to use to filter the results.
entity_statuses
array[String]
Entity status
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items
translate_interests_to_names
Boolean
Return interests as text names (if value is true) rather than topic IDs.

Responses


adGroups/update

Update ad groups

Update multiple existing ad groups.


/ad_accounts/{ad_account_id}/ad_groups

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups" \
 -d '{
  "bid_in_micro_currency" : 5000000,
  "end_time" : 5705424000,
  "auto_targeting_enabled" : true,
  "tracking_urls" : {
    "engagement" : [ "engagement", "engagement" ],
    "audience_verification" : [ "audience_verification", "audience_verification" ],
    "impression" : [ "impression", "impression" ],
    "buyable_button" : [ "buyable_button", "buyable_button" ],
    "click" : [ "click", "click" ]
  },
  "budget_in_micro_currency" : 5000000,
  "bid_strategy_type" : "MAX_BID",
  "start_time" : 5686848000,
  "billable_event" : "CLICKTHROUGH",
  "targeting_spec" : {
    "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
    "GEO" : [ "GEO", "GEO" ],
    "LOCATION" : [ "LOCATION", "LOCATION" ],
    "LOCALE" : [ "LOCALE", "LOCALE" ],
    "AGE_BUCKET" : [ "35-44", "50-54" ],
    "SHOPPING_RETARGETING" : [ {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    }, {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    } ],
    "GENDER" : [ "unknown", "unknown" ],
    "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
    "APPTYPE" : [ "ipad", "iphone" ],
    "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
    "INTEREST" : [ "INTEREST", "INTEREST" ]
  },
  "name" : "Ad Group For Pin: 687195905986",
  "lifetime_frequency_cap" : 100,
  "id" : "2680060704746",
  "optimization_goal_metadata" : {
    "frequency_goal_metadata" : {
      "timerange" : "DAY",
      "frequency" : 5
    },
    "conversion_tag_v3_goal_metadata" : {
      "attribution_windows" : {
        "view_window_days" : 1,
        "click_window_days" : 0,
        "engagement_window_days" : 6
      },
      "conversion_tag_id" : "conversion_tag_id",
      "learning_mode_type" : "ACTIVE",
      "conversion_event" : "PAGE_VISIT",
      "is_roas_optimized" : true,
      "cpa_goal_value_in_micro_currency" : "cpa_goal_value_in_micro_currency"
    },
    "scrollup_goal_metadata" : {
      "scrollup_goal_value_in_micro_currency" : "scrollup_goal_value_in_micro_currency"
    }
  },
  "placement_group" : "placement_group",
  "budget_type" : "budget_type",
  "campaign_id" : "626736533506",
  "status" : "status",
  "pacing_delivery_type" : "pacing_delivery_type"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdGroupUpdateRequest] adGroupUpdateRequest = ; // array[AdGroupUpdateRequest] | 

        try {
            AdGroupArrayResponse result = apiInstance.adGroups/update(adAccountId, adGroupUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[AdGroupUpdateRequest] adGroupUpdateRequest = new array[AdGroupUpdateRequest](); // array[AdGroupUpdateRequest] | 

try {
    final result = await api_instance.adGroups/update(adAccountId, adGroupUpdateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adGroups/update: $e\n');
}

import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdGroupUpdateRequest] adGroupUpdateRequest = ; // array[AdGroupUpdateRequest] | 

        try {
            AdGroupArrayResponse result = apiInstance.adGroups/update(adAccountId, adGroupUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroups/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[AdGroupUpdateRequest] *adGroupUpdateRequest = ; // 

// Update ad groups
[apiInstance adGroups/updateWith:adAccountId
    adGroupUpdateRequest:adGroupUpdateRequest
              completionHandler: ^(AdGroupArrayResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adGroupUpdateRequest = ; // {array[AdGroupUpdateRequest]} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adGroups/update(adAccountId, adGroupUpdateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroups/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adGroupUpdateRequest = new array[AdGroupUpdateRequest](); // array[AdGroupUpdateRequest] | 

            try {
                // Update ad groups
                AdGroupArrayResponse result = apiInstance.adGroups/update(adAccountId, adGroupUpdateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdGroupsApi.adGroups/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adGroupUpdateRequest = ; // array[AdGroupUpdateRequest] | 

try {
    $result = $api_instance->adGroups/update($adAccountId, $adGroupUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdGroupsApi->adGroups/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adGroupUpdateRequest = [WWW::OPenAPIClient::Object::array[AdGroupUpdateRequest]->new()]; # array[AdGroupUpdateRequest] | 

eval {
    my $result = $api_instance->adGroups/update(adAccountId => $adAccountId, adGroupUpdateRequest => $adGroupUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdGroupsApi->adGroups/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adGroupUpdateRequest =  # array[AdGroupUpdateRequest] | 

try:
    # Update ad groups
    api_response = api_instance.ad_groups/update(adAccountId, adGroupUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdGroupsApi->adGroups/update: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adGroupUpdateRequest = ; // array[AdGroupUpdateRequest]

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroups/update(adAccountId, adGroupUpdateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adGroupUpdateRequest *

List of ad groups to update, size limit [1, 30].

Responses


adGroupsBidFloor/get

Get bid floors

List bid floors for your campaign configuration. Bid floors are given in microcurrency values based on the currency in the bid floor specification. <p/> <p>Microcurrency is used to track very small transactions, based on the currency set in the advertiser’s profile.</p> <p>A microcurrency unit is 10^(-6) of the standard unit of currency selected in the advertiser’s profile.</p> <p><strong>Equivalency equations</strong>, using dollars as an example currency:</p> <ul> <li>$1 = 1,000,000 microdollars</li> <li>1 microdollar = $0.000001 </li> </ul> <p><strong>To convert between currency and microcurrency</strong>, using dollars as an example currency:</p> <ul> <li>To convert dollars to microdollars, mutiply dollars by 1,000,000</li> <li>To convert microdollars to dollars, divide microdollars by 1,000,000</li> </ul> For more on bid floors see <a class="reference external" href="https://help.pinterest.com/en/business/article/set-your-bid"> Set your bid</a>.


/ad_accounts/{ad_account_id}/bid_floor

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/bid_floor" \
 -d '{
  "targeting_spec" : {
    "GEO" : [ "BE-VOV" ],
    "LOCATION" : [ "US" ],
    "LOCALE" : [ "cs" ],
    "AGE_BUCKET" : [ "25-34" ],
    "AUDIENCE_INCLUDE" : [ "2542620905473" ],
    "SHOPPING_RETARGETING" : [ {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    }, {
      "lookback_window" : 30,
      "exclusion_window" : 14,
      "tag_types" : [ 0, 6 ]
    } ],
    "GENDER" : [ "male" ],
    "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN" ],
    "APPTYPE" : [ "iphone" ],
    "AUDIENCE_EXCLUDE" : [ "2542620905475" ],
    "INTEREST" : [ "925056443165" ]
  },
  "bid_floor_specs" : [ {
    "billable_event" : "CLICKTHROUGH",
    "creative_type" : "REGULAR",
    "currency" : "USD",
    "countries" : [ "US", "US" ],
    "optimization_goal_metadata" : {
      "frequency_goal_metadata" : {
        "timerange" : "DAY",
        "frequency" : 5
      },
      "conversion_tag_v3_goal_metadata" : {
        "attribution_windows" : {
          "view_window_days" : 1,
          "click_window_days" : 0,
          "engagement_window_days" : 6
        },
        "conversion_tag_id" : "123456789",
        "learning_mode_type" : "ACTIVE",
        "conversion_event" : "PAGE_VISIT",
        "is_roas_optimized" : true,
        "cpa_goal_value_in_micro_currency" : "123456789"
      },
      "scrollup_goal_metadata" : {
        "scrollup_goal_value_in_micro_currency" : "123456789"
      }
    }
  }, {
    "billable_event" : "CLICKTHROUGH",
    "creative_type" : "REGULAR",
    "currency" : "USD",
    "countries" : [ "US", "US" ],
    "optimization_goal_metadata" : {
      "frequency_goal_metadata" : {
        "timerange" : "DAY",
        "frequency" : 5
      },
      "conversion_tag_v3_goal_metadata" : {
        "attribution_windows" : {
          "view_window_days" : 1,
          "click_window_days" : 0,
          "engagement_window_days" : 6
        },
        "conversion_tag_id" : "123456789",
        "learning_mode_type" : "ACTIVE",
        "conversion_event" : "PAGE_VISIT",
        "is_roas_optimized" : true,
        "cpa_goal_value_in_micro_currency" : "123456789"
      },
      "scrollup_goal_metadata" : {
        "scrollup_goal_value_in_micro_currency" : "123456789"
      }
    }
  } ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        BidFloorRequest bidFloorRequest = ; // BidFloorRequest | 

        try {
            BidFloor result = apiInstance.adGroupsBidFloor/get(adAccountId, bidFloorRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroupsBidFloor/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final BidFloorRequest bidFloorRequest = new BidFloorRequest(); // BidFloorRequest | 

try {
    final result = await api_instance.adGroupsBidFloor/get(adAccountId, bidFloorRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adGroupsBidFloor/get: $e\n');
}

import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        BidFloorRequest bidFloorRequest = ; // BidFloorRequest | 

        try {
            BidFloor result = apiInstance.adGroupsBidFloor/get(adAccountId, bidFloorRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdGroupsApi#adGroupsBidFloor/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
BidFloorRequest *bidFloorRequest = ; // 

// Get bid floors
[apiInstance adGroupsBidFloor/getWith:adAccountId
    bidFloorRequest:bidFloorRequest
              completionHandler: ^(BidFloor output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var bidFloorRequest = ; // {BidFloorRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adGroupsBidFloor/get(adAccountId, bidFloorRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroupsBidFloor/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bidFloorRequest = new BidFloorRequest(); // BidFloorRequest | 

            try {
                // Get bid floors
                BidFloor result = apiInstance.adGroupsBidFloor/get(adAccountId, bidFloorRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdGroupsApi.adGroupsBidFloor/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bidFloorRequest = ; // BidFloorRequest | 

try {
    $result = $api_instance->adGroupsBidFloor/get($adAccountId, $bidFloorRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdGroupsApi->adGroupsBidFloor/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bidFloorRequest = WWW::OPenAPIClient::Object::BidFloorRequest->new(); # BidFloorRequest | 

eval {
    my $result = $api_instance->adGroupsBidFloor/get(adAccountId => $adAccountId, bidFloorRequest => $bidFloorRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdGroupsApi->adGroupsBidFloor/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bidFloorRequest =  # BidFloorRequest | 

try:
    # Get bid floors
    api_response = api_instance.ad_groups_bid_floor/get(adAccountId, bidFloorRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdGroupsApi->adGroupsBidFloor/get: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bidFloorRequest = ; // BidFloorRequest

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroupsBidFloor/get(adAccountId, bidFloorRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
bidFloorRequest *

Parameters to get bid_floor info

Responses


adGroupsTargetingAnalytics/get

Get targeting analytics for ad groups

Get targeting analytics for one or more ad groups. For the requested ad group(s) and metrics, the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. "age_bucket") for applicable values (e.g. "45-49"). <p/> - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/ad_groups/targeting_analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_groups/targeting_analytics?ad_group_ids=&start_date=2013-10-20&end_date=2013-10-20&targeting_types=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION&attribution_types="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdGroupsApi;

import java.io.File;
import java.util.*;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.adGroupsTargetingAnalytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdGroupsApi#adGroupsTargetingAnalytics/get"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[AdsAnalyticsTargetingType] targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. final ConversionReportAttributionType attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report try { final result = await api_instance.adGroupsTargetingAnalytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); print(result); } catch (e) { print('Exception when calling DefaultApi->adGroupsTargetingAnalytics/get: $e\n'); }
import org.openapitools.client.api.AdGroupsApi;

public class AdGroupsApiExample {
    public static void main(String[] args) {
        AdGroupsApi apiInstance = new AdGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.adGroupsTargetingAnalytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdGroupsApi#adGroupsTargetingAnalytics/get"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdGroupsApi *apiInstance = [[AdGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *adGroupIds = ; // List of Ad group Ids to use to filter the results. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[AdsAnalyticsTargetingType] *targetingTypes = ; // Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) ConversionReportAttributionType *attributionTypes = ; // List of types of attribution for the conversion report (optional) (default to null) // Get targeting analytics for ad groups [apiInstance adGroupsTargetingAnalytics/getWith:adAccountId adGroupIds:adGroupIds startDate:startDate endDate:endDate targetingTypes:targetingTypes columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime attributionTypes:attributionTypes completionHandler: ^(MetricsResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adGroupIds = ; // {array[String]} List of Ad group Ids to use to filter the results.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var targetingTypes = ; // {array[AdsAnalyticsTargetingType]} Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION, // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. 'attributionTypes': // {ConversionReportAttributionType} List of types of attribution for the conversion report }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.adGroupsTargetingAnalytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adGroupsTargetingAnalytics/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) var attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try { // Get targeting analytics for ad groups MetricsResponse result = apiInstance.adGroupsTargetingAnalytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdGroupsApi.adGroupsTargetingAnalytics/get: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. $columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. $attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { $result = $api_instance->adGroupsTargetingAnalytics/get($adAccountId, $adGroupIds, $startDate, $endDate, $targetingTypes, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime, $attributionTypes); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdGroupsApi->adGroupsTargetingAnalytics/get: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adGroupIds = []; # array[String] | List of Ad group Ids to use to filter the results.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $targetingTypes = []; # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. my $attributionTypes = ; # ConversionReportAttributionType | List of types of attribution for the conversion report eval { my $result = $api_instance->adGroupsTargetingAnalytics/get(adAccountId => $adAccountId, adGroupIds => $adGroupIds, startDate => $startDate, endDate => $endDate, targetingTypes => $targetingTypes, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime, attributionTypes => $attributionTypes); print Dumper($result); }; if ($@) { warn "Exception when calling AdGroupsApi->adGroupsTargetingAnalytics/get: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adGroupIds =  # array[String] | List of Ad group Ids to use to filter the results. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
targetingTypes =  # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) columns = # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) attributionTypes = # ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try: # Get targeting analytics for ad groups api_response = api_instance.ad_groups_targeting_analytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime, attributionTypes=attributionTypes) pprint(api_response) except ApiException as e: print("Exception when calling AdGroupsApi->adGroupsTargetingAnalytics/get: %s\n" % e)
extern crate AdGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adGroupIds = ; // array[String]
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let targetingTypes = ; // array[AdsAnalyticsTargetingType]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String
    let attributionTypes = ; // ConversionReportAttributionType

    let mut context = AdGroupsApi::Context::default();
    let result = client.adGroupsTargetingAnalytics/get(adAccountId, adGroupIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
ad_group_ids*
array[String]
List of Ad group Ids to use to filter the results.
Required
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
targeting_types*
array[AdsAnalyticsTargetingType]
Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
attribution_types
ConversionReportAttributionType
List of types of attribution for the conversion report

Responses


Ads

adPreviews/create

Create ad preview with pin or image

Create an ad preview given an ad account ID and either an existing organic pin ID or the URL for an image to be used to create the Pin and the ad. <p/> If you are creating a preview from an existing Pin, that Pin must be promotable: that is, it must have a clickthrough link and meet other requirements. (See <a href="https://help.pinterest.com/en/business/article/promoted-pins-overview" target="_blank">Ads Overview</a>.) <p/> You can view the returned preview URL on a webpage or iframe for 7 days, after which the URL expires.


/ad_accounts/{ad_account_id}/ad_previews

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ad_previews" \
 -d '{
  "image_url" : "https://somewebsite.com/someimage.jpg",
  "title" : "My Preview Image"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdPreviewRequest adPreviewRequest = ; // AdPreviewRequest | 

        try {
            AdPreviewURLResponse result = apiInstance.adPreviews/create(adAccountId, adPreviewRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#adPreviews/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AdPreviewRequest adPreviewRequest = new AdPreviewRequest(); // AdPreviewRequest | 

try {
    final result = await api_instance.adPreviews/create(adAccountId, adPreviewRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adPreviews/create: $e\n');
}

import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdPreviewRequest adPreviewRequest = ; // AdPreviewRequest | 

        try {
            AdPreviewURLResponse result = apiInstance.adPreviews/create(adAccountId, adPreviewRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#adPreviews/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AdPreviewRequest *adPreviewRequest = ; // 

// Create ad preview with pin or image
[apiInstance adPreviews/createWith:adAccountId
    adPreviewRequest:adPreviewRequest
              completionHandler: ^(AdPreviewURLResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adPreviewRequest = ; // {AdPreviewRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adPreviews/create(adAccountId, adPreviewRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adPreviews/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adPreviewRequest = new AdPreviewRequest(); // AdPreviewRequest | 

            try {
                // Create ad preview with pin or image
                AdPreviewURLResponse result = apiInstance.adPreviews/create(adAccountId, adPreviewRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdsApi.adPreviews/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adPreviewRequest = ; // AdPreviewRequest | 

try {
    $result = $api_instance->adPreviews/create($adAccountId, $adPreviewRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdsApi->adPreviews/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adPreviewRequest = WWW::OPenAPIClient::Object::AdPreviewRequest->new(); # AdPreviewRequest | 

eval {
    my $result = $api_instance->adPreviews/create(adAccountId => $adAccountId, adPreviewRequest => $adPreviewRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdsApi->adPreviews/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adPreviewRequest =  # AdPreviewRequest | 

try:
    # Create ad preview with pin or image
    api_response = api_instance.ad_previews/create(adAccountId, adPreviewRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdsApi->adPreviews/create: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adPreviewRequest = ; // AdPreviewRequest

    let mut context = AdsApi::Context::default();
    let result = client.adPreviews/create(adAccountId, adPreviewRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adPreviewRequest *

Create ad preview with pin or image.

Responses


adTargetingAnalytics/get

Get targeting analytics for ads

Get targeting analytics for one or more ads. For the requested ad(s) and metrics, the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. "age_bucket") for applicable values (e.g. "45-49"). <p/> - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/ads/targeting_analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads/targeting_analytics?ad_ids=&start_date=2013-10-20&end_date=2013-10-20&targeting_types=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION&attribution_types="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] adIds = ; // array[String] | List of Ad Ids to use to filter the results.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.adTargetingAnalytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdsApi#adTargetingAnalytics/get"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] adIds = new array[String](); // array[String] | List of Ad Ids to use to filter the results.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[AdsAnalyticsTargetingType] targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. final ConversionReportAttributionType attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report try { final result = await api_instance.adTargetingAnalytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); print(result); } catch (e) { print('Exception when calling DefaultApi->adTargetingAnalytics/get: $e\n'); }
import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] adIds = ; // array[String] | List of Ad Ids to use to filter the results.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.adTargetingAnalytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdsApi#adTargetingAnalytics/get"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *adIds = ; // List of Ad Ids to use to filter the results. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[AdsAnalyticsTargetingType] *targetingTypes = ; // Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) ConversionReportAttributionType *attributionTypes = ; // List of types of attribution for the conversion report (optional) (default to null) // Get targeting analytics for ads [apiInstance adTargetingAnalytics/getWith:adAccountId adIds:adIds startDate:startDate endDate:endDate targetingTypes:targetingTypes columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime attributionTypes:attributionTypes completionHandler: ^(MetricsResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adIds = ; // {array[String]} List of Ad Ids to use to filter the results.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var targetingTypes = ; // {array[AdsAnalyticsTargetingType]} Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION, // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. 'attributionTypes': // {ConversionReportAttributionType} List of types of attribution for the conversion report }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.adTargetingAnalytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adTargetingAnalytics/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adIds = new array[String](); // array[String] | List of Ad Ids to use to filter the results. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) var attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try { // Get targeting analytics for ads MetricsResponse result = apiInstance.adTargetingAnalytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdsApi.adTargetingAnalytics/get: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adIds = ; // array[String] | List of Ad Ids to use to filter the results.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. $columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. $attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { $result = $api_instance->adTargetingAnalytics/get($adAccountId, $adIds, $startDate, $endDate, $targetingTypes, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime, $attributionTypes); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdsApi->adTargetingAnalytics/get: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adIds = []; # array[String] | List of Ad Ids to use to filter the results.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $targetingTypes = []; # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. my $attributionTypes = ; # ConversionReportAttributionType | List of types of attribution for the conversion report eval { my $result = $api_instance->adTargetingAnalytics/get(adAccountId => $adAccountId, adIds => $adIds, startDate => $startDate, endDate => $endDate, targetingTypes => $targetingTypes, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime, attributionTypes => $attributionTypes); print Dumper($result); }; if ($@) { warn "Exception when calling AdsApi->adTargetingAnalytics/get: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adIds =  # array[String] | List of Ad Ids to use to filter the results. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
targetingTypes =  # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) columns = # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) attributionTypes = # ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try: # Get targeting analytics for ads api_response = api_instance.ad_targeting_analytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime, attributionTypes=attributionTypes) pprint(api_response) except ApiException as e: print("Exception when calling AdsApi->adTargetingAnalytics/get: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adIds = ; // array[String]
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let targetingTypes = ; // array[AdsAnalyticsTargetingType]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String
    let attributionTypes = ; // ConversionReportAttributionType

    let mut context = AdsApi::Context::default();
    let result = client.adTargetingAnalytics/get(adAccountId, adIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
ad_ids*
array[String]
List of Ad Ids to use to filter the results.
Required
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
targeting_types*
array[AdsAnalyticsTargetingType]
Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
attribution_types
ConversionReportAttributionType
List of types of attribution for the conversion report

Responses


ads/analytics

Get ad analytics

Get analytics for the specified ads in the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/ads/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads/analytics?start_date=2013-10-20&end_date=2013-10-20&ad_ids=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] adIds = ; // array[String] | List of Ad Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[AdsAnalyticsResponse_inner] result = apiInstance.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdsApi#ads/analytics"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[String] adIds = new array[String](); // array[String] | List of Ad Ids to use to filter the results.
final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { final result = await api_instance.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); print(result); } catch (e) { print('Exception when calling DefaultApi->ads/analytics: $e\n'); }
import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] adIds = ; // array[String] | List of Ad Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[AdsAnalyticsResponse_inner] result = apiInstance.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdsApi#ads/analytics"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[String] *adIds = ; // List of Ad Ids to use to filter the results. (default to null)
array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) // Get ad analytics [apiInstance ads/analyticsWith:adAccountId startDate:startDate endDate:endDate adIds:adIds columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime completionHandler: ^(array[AdsAnalyticsResponse_inner] output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var adIds = ; // {array[String]} List of Ad Ids to use to filter the results.
var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ads/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var adIds = new array[String](); // array[String] | List of Ad Ids to use to filter the results. (default to null)
            var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try { // Get ad analytics array[AdsAnalyticsResponse_inner] result = apiInstance.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling AdsApi.ads/analytics: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$adIds = ; // array[String] | List of Ad Ids to use to filter the results.
$columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { $result = $api_instance->ads/analytics($adAccountId, $startDate, $endDate, $adIds, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime); print_r($result); } catch (Exception $e) { echo 'Exception when calling AdsApi->ads/analytics: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $adIds = []; # array[String] | List of Ad Ids to use to filter the results.
my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. eval { my $result = $api_instance->ads/analytics(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, adIds => $adIds, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime); print Dumper($result); }; if ($@) { warn "Exception when calling AdsApi->ads/analytics: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
adIds =  # array[String] | List of Ad Ids to use to filter the results. (default to null)
columns =  # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try: # Get ad analytics api_response = api_instance.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime) pprint(api_response) except ApiException as e: print("Exception when calling AdsApi->ads/analytics: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let adIds = ; // array[String]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String

    let mut context = AdsApi::Context::default();
    let result = client.ads/analytics(adAccountId, startDate, endDate, adIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
ad_ids*
array[String]
List of Ad Ids to use to filter the results.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.

Responses


ads/create

Create ads

Create multiple new ads. Request must contain ad_group_id, creative_type, and the source Pin pin_id.


/ad_accounts/{ad_account_id}/ads

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads" \
 -d '{
  "is_removable" : false,
  "view_tracking_url" : "view_tracking_url",
  "android_deep_link" : "android_deep_link",
  "destination_url" : "destination_url",
  "carousel_android_deep_links" : [ "carousel_android_deep_links", "carousel_android_deep_links" ],
  "carousel_destination_urls" : [ "carousel_destination_urls", "carousel_destination_urls" ],
  "tracking_urls" : {
    "engagement" : [ "engagement", "engagement" ],
    "audience_verification" : [ "audience_verification", "audience_verification" ],
    "impression" : [ "impression", "impression" ],
    "buyable_button" : [ "buyable_button", "buyable_button" ],
    "click" : [ "click", "click" ]
  },
  "ios_deep_link" : "ios_deep_link",
  "carousel_ios_deep_links" : [ "carousel_ios_deep_links", "carousel_ios_deep_links" ],
  "click_tracking_url" : "click_tracking_url",
  "is_pin_deleted" : false,
  "creative_type" : "REGULAR",
  "grid_click_type" : "CLOSEUP",
  "quiz_pin_data" : {
    "questions" : [ {
      "question_id" : 1,
      "question_text" : "Where do you thrive?",
      "options" : [ {
        "text" : "Hangout vibes"
      }, {
        "text" : "Time to party!"
      }, {
        "text" : "Keeping it lowkey"
      } ]
    }, {
      "question_id" : 1,
      "question_text" : "Where do you thrive?",
      "options" : [ {
        "text" : "Hangout vibes"
      }, {
        "text" : "Time to party!"
      }, {
        "text" : "Keeping it lowkey"
      } ]
    } ],
    "results" : [ {
      "organic_pin_id" : "pinId",
      "android_deep_link" : "https://www.pinterest.com/",
      "ios_deep_link" : "https://www.pinterest.com/",
      "destination_url" : "https://www.pinterest.com/"
    }, {
      "organic_pin_id" : "pinId",
      "android_deep_link" : "https://www.pinterest.com/",
      "ios_deep_link" : "https://www.pinterest.com/",
      "destination_url" : "https://www.pinterest.com/"
    } ]
  },
  "name" : "name",
  "lead_form_id" : "lead_form_id",
  "customizable_cta_type" : "LEARN_MORE",
  "ad_group_id" : "2680059592705",
  "pin_id" : "394205773611545468",
  "status" : "ACTIVE"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdCreateRequest] adCreateRequest = ; // array[AdCreateRequest] | 

        try {
            AdArrayResponse result = apiInstance.ads/create(adAccountId, adCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[AdCreateRequest] adCreateRequest = new array[AdCreateRequest](); // array[AdCreateRequest] | 

try {
    final result = await api_instance.ads/create(adAccountId, adCreateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ads/create: $e\n');
}

import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdCreateRequest] adCreateRequest = ; // array[AdCreateRequest] | 

        try {
            AdArrayResponse result = apiInstance.ads/create(adAccountId, adCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[AdCreateRequest] *adCreateRequest = ; // 

// Create ads
[apiInstance ads/createWith:adAccountId
    adCreateRequest:adCreateRequest
              completionHandler: ^(AdArrayResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adCreateRequest = ; // {array[AdCreateRequest]} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ads/create(adAccountId, adCreateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ads/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adCreateRequest = new array[AdCreateRequest](); // array[AdCreateRequest] | 

            try {
                // Create ads
                AdArrayResponse result = apiInstance.ads/create(adAccountId, adCreateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdsApi.ads/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adCreateRequest = ; // array[AdCreateRequest] | 

try {
    $result = $api_instance->ads/create($adAccountId, $adCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdsApi->ads/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adCreateRequest = [WWW::OPenAPIClient::Object::array[AdCreateRequest]->new()]; # array[AdCreateRequest] | 

eval {
    my $result = $api_instance->ads/create(adAccountId => $adAccountId, adCreateRequest => $adCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdsApi->ads/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adCreateRequest =  # array[AdCreateRequest] | 

try:
    # Create ads
    api_response = api_instance.ads/create(adAccountId, adCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdsApi->ads/create: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adCreateRequest = ; // array[AdCreateRequest]

    let mut context = AdsApi::Context::default();
    let result = client.ads/create(adAccountId, adCreateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adCreateRequest *

List of ads to create, size limit [1, 30].

Responses


ads/get

Get ad

Get a specific ad given the ad ID. If your pin is rejected, rejected_reasons will contain additional information from the Ad Review process. For more information about our policies and rejection reasons see the <a href="https://www.pinterest.com/_/_/policy/advertising-guidelines/" target="_blank">Pinterest advertising standards</a>.


/ad_accounts/{ad_account_id}/ads/{ad_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads/{ad_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String adId = adId_example; // String | Unique identifier of an ad.

        try {
            AdResponse result = apiInstance.ads/get(adAccountId, adId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String adId = new String(); // String | Unique identifier of an ad.

try {
    final result = await api_instance.ads/get(adAccountId, adId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ads/get: $e\n');
}

import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String adId = adId_example; // String | Unique identifier of an ad.

        try {
            AdResponse result = apiInstance.ads/get(adAccountId, adId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *adId = adId_example; // Unique identifier of an ad. (default to null)

// Get ad
[apiInstance ads/getWith:adAccountId
    adId:adId
              completionHandler: ^(AdResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adId = adId_example; // {String} Unique identifier of an ad.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ads/get(adAccountId, adId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ads/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adId = adId_example;  // String | Unique identifier of an ad. (default to null)

            try {
                // Get ad
                AdResponse result = apiInstance.ads/get(adAccountId, adId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdsApi.ads/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adId = adId_example; // String | Unique identifier of an ad.

try {
    $result = $api_instance->ads/get($adAccountId, $adId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdsApi->ads/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adId = adId_example; # String | Unique identifier of an ad.

eval {
    my $result = $api_instance->ads/get(adAccountId => $adAccountId, adId => $adId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdsApi->ads/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adId = adId_example # String | Unique identifier of an ad. (default to null)

try:
    # Get ad
    api_response = api_instance.ads/get(adAccountId, adId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdsApi->ads/get: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adId = adId_example; // String

    let mut context = AdsApi::Context::default();
    let result = client.ads/get(adAccountId, adId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
ad_id*
String
Unique identifier of an ad.
Required

Responses


ads/list

List ads

List ads that meet the filters provided: - Listed campaign ids or ad group ids or ad ids - Listed entity statuses <p/> If no filter is provided, all ads in the ad account are returned. <p/> <strong>Note:</strong><p/> Provide only campaign_id or ad_group_id or ad_id. Do not provide more than one type. <p/> Review status is provided for each ad; if review_status is REJECTED, the rejected_reasons field will contain additional information. For more, see <a href="https://policy.pinterest.com/en/advertising-guidelines">Pinterest advertising standards</a>.


/ad_accounts/{ad_account_id}/ads

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads?campaign_ids=&ad_group_ids=&ad_ids=&entity_statuses=&page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        array[String] adIds = ; // array[String] | List of Ad Ids to use to filter the results.
        array[String] entityStatuses = ; // array[String] | Entity status
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            ads_list_200_response result = apiInstance.ads/list(adAccountId, campaignIds, adGroupIds, adIds, entityStatuses, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results.
final array[String] adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results.
final array[String] adIds = new array[String](); // array[String] | List of Ad Ids to use to filter the results.
final array[String] entityStatuses = new array[String](); // array[String] | Entity status
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.ads/list(adAccountId, campaignIds, adGroupIds, adIds, entityStatuses, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ads/list: $e\n');
}

import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
        array[String] adIds = ; // array[String] | List of Ad Ids to use to filter the results.
        array[String] entityStatuses = ; // array[String] | Entity status
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            ads_list_200_response result = apiInstance.ads/list(adAccountId, campaignIds, adGroupIds, adIds, entityStatuses, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *campaignIds = ; // List of Campaign Ids to use to filter the results. (optional) (default to null)
array[String] *adGroupIds = ; // List of Ad group Ids to use to filter the results. (optional) (default to null)
array[String] *adIds = ; // List of Ad Ids to use to filter the results. (optional) (default to null)
array[String] *entityStatuses = ; // Entity status (optional) (default to ["ACTIVE","PAUSED"])
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// List ads
[apiInstance ads/listWith:adAccountId
    campaignIds:campaignIds
    adGroupIds:adGroupIds
    adIds:adIds
    entityStatuses:entityStatuses
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(ads_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'campaignIds': , // {array[String]} List of Campaign Ids to use to filter the results.
  'adGroupIds': , // {array[String]} List of Ad group Ids to use to filter the results.
  'adIds': , // {array[String]} List of Ad Ids to use to filter the results.
  'entityStatuses': , // {array[String]} Entity status
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ads/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ads/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results. (optional)  (default to null)
            var adGroupIds = new array[String](); // array[String] | List of Ad group Ids to use to filter the results. (optional)  (default to null)
            var adIds = new array[String](); // array[String] | List of Ad Ids to use to filter the results. (optional)  (default to null)
            var entityStatuses = new array[String](); // array[String] | Entity status (optional)  (default to ["ACTIVE","PAUSED"])
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // List ads
                ads_list_200_response result = apiInstance.ads/list(adAccountId, campaignIds, adGroupIds, adIds, entityStatuses, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdsApi.ads/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
$adGroupIds = ; // array[String] | List of Ad group Ids to use to filter the results.
$adIds = ; // array[String] | List of Ad Ids to use to filter the results.
$entityStatuses = ; // array[String] | Entity status
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->ads/list($adAccountId, $campaignIds, $adGroupIds, $adIds, $entityStatuses, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdsApi->ads/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignIds = []; # array[String] | List of Campaign Ids to use to filter the results.
my $adGroupIds = []; # array[String] | List of Ad group Ids to use to filter the results.
my $adIds = []; # array[String] | List of Ad Ids to use to filter the results.
my $entityStatuses = []; # array[String] | Entity status
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->ads/list(adAccountId => $adAccountId, campaignIds => $campaignIds, adGroupIds => $adGroupIds, adIds => $adIds, entityStatuses => $entityStatuses, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdsApi->ads/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignIds =  # array[String] | List of Campaign Ids to use to filter the results. (optional) (default to null)
adGroupIds =  # array[String] | List of Ad group Ids to use to filter the results. (optional) (default to null)
adIds =  # array[String] | List of Ad Ids to use to filter the results. (optional) (default to null)
entityStatuses =  # array[String] | Entity status (optional) (default to ["ACTIVE","PAUSED"])
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # List ads
    api_response = api_instance.ads/list(adAccountId, campaignIds=campaignIds, adGroupIds=adGroupIds, adIds=adIds, entityStatuses=entityStatuses, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdsApi->ads/list: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignIds = ; // array[String]
    let adGroupIds = ; // array[String]
    let adIds = ; // array[String]
    let entityStatuses = ; // array[String]
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = AdsApi::Context::default();
    let result = client.ads/list(adAccountId, campaignIds, adGroupIds, adIds, entityStatuses, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
campaign_ids
array[String]
List of Campaign Ids to use to filter the results.
ad_group_ids
array[String]
List of Ad group Ids to use to filter the results.
ad_ids
array[String]
List of Ad Ids to use to filter the results.
entity_statuses
array[String]
Entity status
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


ads/update

Update ads

Update multiple existing ads


/ad_accounts/{ad_account_id}/ads

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads" \
 -d '{
  "is_removable" : false,
  "view_tracking_url" : "view_tracking_url",
  "android_deep_link" : "android_deep_link",
  "destination_url" : "destination_url",
  "carousel_android_deep_links" : [ "carousel_android_deep_links", "carousel_android_deep_links" ],
  "carousel_destination_urls" : [ "carousel_destination_urls", "carousel_destination_urls" ],
  "tracking_urls" : {
    "engagement" : [ "engagement", "engagement" ],
    "audience_verification" : [ "audience_verification", "audience_verification" ],
    "impression" : [ "impression", "impression" ],
    "buyable_button" : [ "buyable_button", "buyable_button" ],
    "click" : [ "click", "click" ]
  },
  "ios_deep_link" : "ios_deep_link",
  "carousel_ios_deep_links" : [ "carousel_ios_deep_links", "carousel_ios_deep_links" ],
  "click_tracking_url" : "click_tracking_url",
  "is_pin_deleted" : false,
  "creative_type" : "REGULAR",
  "grid_click_type" : "CLOSEUP",
  "quiz_pin_data" : {
    "questions" : [ {
      "question_id" : 1,
      "question_text" : "Where do you thrive?",
      "options" : [ {
        "text" : "Hangout vibes"
      }, {
        "text" : "Time to party!"
      }, {
        "text" : "Keeping it lowkey"
      } ]
    }, {
      "question_id" : 1,
      "question_text" : "Where do you thrive?",
      "options" : [ {
        "text" : "Hangout vibes"
      }, {
        "text" : "Time to party!"
      }, {
        "text" : "Keeping it lowkey"
      } ]
    } ],
    "results" : [ {
      "organic_pin_id" : "pinId",
      "android_deep_link" : "https://www.pinterest.com/",
      "ios_deep_link" : "https://www.pinterest.com/",
      "destination_url" : "https://www.pinterest.com/"
    }, {
      "organic_pin_id" : "pinId",
      "android_deep_link" : "https://www.pinterest.com/",
      "ios_deep_link" : "https://www.pinterest.com/",
      "destination_url" : "https://www.pinterest.com/"
    } ]
  },
  "name" : "name",
  "lead_form_id" : "lead_form_id",
  "customizable_cta_type" : "LEARN_MORE",
  "id" : "687195134316",
  "ad_group_id" : "2680059592705",
  "pin_id" : "394205773611545468",
  "status" : "ACTIVE"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AdsApi;

import java.io.File;
import java.util.*;

public class AdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdUpdateRequest] adUpdateRequest = ; // array[AdUpdateRequest] | 

        try {
            AdArrayResponse result = apiInstance.ads/update(adAccountId, adUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[AdUpdateRequest] adUpdateRequest = new array[AdUpdateRequest](); // array[AdUpdateRequest] | 

try {
    final result = await api_instance.ads/update(adAccountId, adUpdateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ads/update: $e\n');
}

import org.openapitools.client.api.AdsApi;

public class AdsApiExample {
    public static void main(String[] args) {
        AdsApi apiInstance = new AdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[AdUpdateRequest] adUpdateRequest = ; // array[AdUpdateRequest] | 

        try {
            AdArrayResponse result = apiInstance.ads/update(adAccountId, adUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdsApi#ads/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AdsApi *apiInstance = [[AdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[AdUpdateRequest] *adUpdateRequest = ; // 

// Update ads
[apiInstance ads/updateWith:adAccountId
    adUpdateRequest:adUpdateRequest
              completionHandler: ^(AdArrayResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adUpdateRequest = ; // {array[AdUpdateRequest]} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ads/update(adAccountId, adUpdateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ads/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adUpdateRequest = new array[AdUpdateRequest](); // array[AdUpdateRequest] | 

            try {
                // Update ads
                AdArrayResponse result = apiInstance.ads/update(adAccountId, adUpdateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AdsApi.ads/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adUpdateRequest = ; // array[AdUpdateRequest] | 

try {
    $result = $api_instance->ads/update($adAccountId, $adUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdsApi->ads/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adUpdateRequest = [WWW::OPenAPIClient::Object::array[AdUpdateRequest]->new()]; # array[AdUpdateRequest] | 

eval {
    my $result = $api_instance->ads/update(adAccountId => $adAccountId, adUpdateRequest => $adUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AdsApi->ads/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adUpdateRequest =  # array[AdUpdateRequest] | 

try:
    # Update ads
    api_response = api_instance.ads/update(adAccountId, adUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AdsApi->ads/update: %s\n" % e)
extern crate AdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adUpdateRequest = ; // array[AdUpdateRequest]

    let mut context = AdsApi::Context::default();
    let result = client.ads/update(adAccountId, adUpdateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adUpdateRequest *

List of ads to update, size limit [1, 30]

Responses


AudienceInsights

audienceInsights/get

Get audience insights

Get Audience Insights for an ad account. The response will return insights for 3 types of audiences: the ad account's engaged audience on Pinterest, the ad account's total audience on Pinterest and Pinterest's total audience.<p/> <a href="https://help.pinterest.com/en/business/article/audience-insights" target="_blank">Learn more about Audience Insights</a>.


/ad_accounts/{ad_account_id}/audience_insights

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/audience_insights?audience_insight_type="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudienceInsightsApi;

import java.io.File;
import java.util.*;

public class AudienceInsightsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudienceInsightsApi apiInstance = new AudienceInsightsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AudienceInsightType audienceInsightType = ; // AudienceInsightType | Type of audience insights.

        try {
            AudienceInsightsResponse result = apiInstance.audienceInsights/get(adAccountId, audienceInsightType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudienceInsightsApi#audienceInsights/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AudienceInsightType audienceInsightType = new AudienceInsightType(); // AudienceInsightType | Type of audience insights.

try {
    final result = await api_instance.audienceInsights/get(adAccountId, audienceInsightType);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audienceInsights/get: $e\n');
}

import org.openapitools.client.api.AudienceInsightsApi;

public class AudienceInsightsApiExample {
    public static void main(String[] args) {
        AudienceInsightsApi apiInstance = new AudienceInsightsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AudienceInsightType audienceInsightType = ; // AudienceInsightType | Type of audience insights.

        try {
            AudienceInsightsResponse result = apiInstance.audienceInsights/get(adAccountId, audienceInsightType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudienceInsightsApi#audienceInsights/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudienceInsightsApi *apiInstance = [[AudienceInsightsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AudienceInsightType *audienceInsightType = ; // Type of audience insights. (default to null)

// Get audience insights
[apiInstance audienceInsights/getWith:adAccountId
    audienceInsightType:audienceInsightType
              completionHandler: ^(AudienceInsightsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudienceInsightsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var audienceInsightType = ; // {AudienceInsightType} Type of audience insights.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audienceInsights/get(adAccountId, audienceInsightType, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audienceInsights/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudienceInsightsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var audienceInsightType = new AudienceInsightType(); // AudienceInsightType | Type of audience insights. (default to null)

            try {
                // Get audience insights
                AudienceInsightsResponse result = apiInstance.audienceInsights/get(adAccountId, audienceInsightType);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudienceInsightsApi.audienceInsights/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudienceInsightsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$audienceInsightType = ; // AudienceInsightType | Type of audience insights.

try {
    $result = $api_instance->audienceInsights/get($adAccountId, $audienceInsightType);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudienceInsightsApi->audienceInsights/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudienceInsightsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudienceInsightsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $audienceInsightType = ; # AudienceInsightType | Type of audience insights.

eval {
    my $result = $api_instance->audienceInsights/get(adAccountId => $adAccountId, audienceInsightType => $audienceInsightType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudienceInsightsApi->audienceInsights/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudienceInsightsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
audienceInsightType =  # AudienceInsightType | Type of audience insights. (default to null)

try:
    # Get audience insights
    api_response = api_instance.audience_insights/get(adAccountId, audienceInsightType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudienceInsightsApi->audienceInsights/get: %s\n" % e)
extern crate AudienceInsightsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let audienceInsightType = ; // AudienceInsightType

    let mut context = AudienceInsightsApi::Context::default();
    let result = client.audienceInsights/get(adAccountId, audienceInsightType, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
audience_insight_type*
AudienceInsightType
Type of audience insights.
Required

Responses


audienceInsightsScopeAndType/get

Get audience insights scope and type

Get the scope and type of available audiences, which along with a date, is an audience that has recently had an interaction (referred to here as a type) on pins. Interacted pins can belong to at least the most common **partner** or **Pinterest** scopes. This means that user interactions made on advertiser or partner pins will have the **partner** scope. You can also have user interactions performed in general on Pinterest with the **Pinterest** scope. In that case, you can then use the returned type and scope values together on requests to other endpoints to retrieve insight metrics for a desired audience.


/ad_accounts/{ad_account_id}/insights/audiences

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/insights/audiences"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudienceInsightsApi;

import java.io.File;
import java.util.*;

public class AudienceInsightsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudienceInsightsApi apiInstance = new AudienceInsightsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            AudienceDefinitionResponse result = apiInstance.audienceInsightsScopeAndType/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudienceInsightsApi#audienceInsightsScopeAndType/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.audienceInsightsScopeAndType/get(adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audienceInsightsScopeAndType/get: $e\n');
}

import org.openapitools.client.api.AudienceInsightsApi;

public class AudienceInsightsApiExample {
    public static void main(String[] args) {
        AudienceInsightsApi apiInstance = new AudienceInsightsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            AudienceDefinitionResponse result = apiInstance.audienceInsightsScopeAndType/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudienceInsightsApi#audienceInsightsScopeAndType/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudienceInsightsApi *apiInstance = [[AudienceInsightsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)

// Get audience insights scope and type
[apiInstance audienceInsightsScopeAndType/getWith:adAccountId
              completionHandler: ^(AudienceDefinitionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudienceInsightsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audienceInsightsScopeAndType/get(adAccountId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audienceInsightsScopeAndType/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudienceInsightsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)

            try {
                // Get audience insights scope and type
                AudienceDefinitionResponse result = apiInstance.audienceInsightsScopeAndType/get(adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudienceInsightsApi.audienceInsightsScopeAndType/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudienceInsightsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->audienceInsightsScopeAndType/get($adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudienceInsightsApi->audienceInsightsScopeAndType/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudienceInsightsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudienceInsightsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->audienceInsightsScopeAndType/get(adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudienceInsightsApi->audienceInsightsScopeAndType/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudienceInsightsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)

try:
    # Get audience insights scope and type
    api_response = api_instance.audience_insights_scope_and_type/get(adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudienceInsightsApi->audienceInsightsScopeAndType/get: %s\n" % e)
extern crate AudienceInsightsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String

    let mut context = AudienceInsightsApi::Context::default();
    let result = client.audienceInsightsScopeAndType/get(adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required

Responses


Audiences

audiences/create

Create audience

Create an audience you can use in targeting for specific ad groups. Targeting combines customer information with the ways users interact with Pinterest to help you reach specific groups of users; you can include or exclude specific audience_ids when you create an ad group. <p/> For more, see <a class="reference external" href="https://help.pinterest.com/en/business/article/audience-targeting" target="_blank">Audience targeting</a>.


/ad_accounts/{ad_account_id}/audiences

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/audiences" \
 -d '{
  "audience_type" : { },
  "name" : "string",
  "rule" : {
    "country" : "US",
    "visitor_source_id" : "549755885175",
    "prefill" : true,
    "customer_list_id" : "5497558859876",
    "event_source" : {
      "=" : [ "web", "mobile" ]
    },
    "objective_type" : [ "AWARENESS" ],
    "event_data" : {
      "video_title" : "How to style your Parker Boots",
      "page_name" : "Our Favorite Pins on Pinterest.",
      "order_quantity" : 1,
      "property" : "Athleta",
      "currency" : "USD",
      "lead_type" : "Newsletter",
      "promo_code" : "WINTER10",
      "line_items" : {
        "product_id" : 1414,
        "product_variant" : "Red",
        "product_brand" : "Parker",
        "product_price" : "99.99",
        "product_variant_id" : "1414-34832",
        "product_name" : "Parker Boots",
        "product_category" : "Shoes",
        "product_quantity" : 2
      },
      "search_query" : "boots",
      "order_id" : "X-151481",
      "value" : "199.98"
    },
    "seed_id" : [ "2542620639259", "2542620639261" ],
    "url" : [ "url", "url" ],
    "ad_account_id" : "549755885175",
    "ingestion_source" : {
      "=" : [ "tag" ]
    },
    "ad_id" : [ "687201361754" ],
    "retention_days" : 30,
    "engager_type" : 1,
    "engagement_type" : "click",
    "percentage" : 3,
    "engagement_domain" : [ "www.somedomain.com" ],
    "event" : "checkout",
    "pin_id" : [ "34567" ],
    "campaign_id" : [ "626744528398" ]
  },
  "description" : "string",
  "ad_account_id" : "549755885175"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudiencesApi;

import java.io.File;
import java.util.*;

public class AudiencesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AudienceCreateRequest audienceCreateRequest = ; // AudienceCreateRequest | 

        try {
            Audience result = apiInstance.audiences/create(adAccountId, audienceCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AudienceCreateRequest audienceCreateRequest = new AudienceCreateRequest(); // AudienceCreateRequest | 

try {
    final result = await api_instance.audiences/create(adAccountId, audienceCreateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audiences/create: $e\n');
}

import org.openapitools.client.api.AudiencesApi;

public class AudiencesApiExample {
    public static void main(String[] args) {
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AudienceCreateRequest audienceCreateRequest = ; // AudienceCreateRequest | 

        try {
            Audience result = apiInstance.audiences/create(adAccountId, audienceCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudiencesApi *apiInstance = [[AudiencesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AudienceCreateRequest *audienceCreateRequest = ; // 

// Create audience
[apiInstance audiences/createWith:adAccountId
    audienceCreateRequest:audienceCreateRequest
              completionHandler: ^(Audience output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudiencesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var audienceCreateRequest = ; // {AudienceCreateRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audiences/create(adAccountId, audienceCreateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audiences/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudiencesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var audienceCreateRequest = new AudienceCreateRequest(); // AudienceCreateRequest | 

            try {
                // Create audience
                Audience result = apiInstance.audiences/create(adAccountId, audienceCreateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudiencesApi.audiences/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudiencesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$audienceCreateRequest = ; // AudienceCreateRequest | 

try {
    $result = $api_instance->audiences/create($adAccountId, $audienceCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->audiences/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudiencesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudiencesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $audienceCreateRequest = WWW::OPenAPIClient::Object::AudienceCreateRequest->new(); # AudienceCreateRequest | 

eval {
    my $result = $api_instance->audiences/create(adAccountId => $adAccountId, audienceCreateRequest => $audienceCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudiencesApi->audiences/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudiencesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
audienceCreateRequest =  # AudienceCreateRequest | 

try:
    # Create audience
    api_response = api_instance.audiences/create(adAccountId, audienceCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudiencesApi->audiences/create: %s\n" % e)
extern crate AudiencesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let audienceCreateRequest = ; // AudienceCreateRequest

    let mut context = AudiencesApi::Context::default();
    let result = client.audiences/create(adAccountId, audienceCreateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
audienceCreateRequest *

List of ads to create, size limit [1, 30]

Responses


audiences/createCustom

Create custom audience

Create a custom audience and find the audiences you want your ads to reach.


/ad_accounts/{ad_account_id}/audiences/custom

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/audiences/custom" \
 -d '{
  "name" : "string",
  "rule" : {
    "country" : "US",
    "visitor_source_id" : "549755885175",
    "prefill" : true,
    "customer_list_id" : "5497558859876",
    "event_source" : {
      "=" : [ "web", "mobile" ]
    },
    "objective_type" : [ "AWARENESS" ],
    "event_data" : {
      "video_title" : "How to style your Parker Boots",
      "page_name" : "Our Favorite Pins on Pinterest.",
      "order_quantity" : 1,
      "property" : "Athleta",
      "currency" : "USD",
      "lead_type" : "Newsletter",
      "promo_code" : "WINTER10",
      "line_items" : {
        "product_id" : 1414,
        "product_variant" : "Red",
        "product_brand" : "Parker",
        "product_price" : "99.99",
        "product_variant_id" : "1414-34832",
        "product_name" : "Parker Boots",
        "product_category" : "Shoes",
        "product_quantity" : 2
      },
      "search_query" : "boots",
      "order_id" : "X-151481",
      "value" : "199.98"
    },
    "seed_id" : [ "2542620639259", "2542620639261" ],
    "url" : [ "url", "url" ],
    "ad_account_id" : "549755885175",
    "ingestion_source" : {
      "=" : [ "tag" ]
    },
    "ad_id" : [ "687201361754" ],
    "retention_days" : 30,
    "engager_type" : 1,
    "engagement_type" : "click",
    "percentage" : 3,
    "engagement_domain" : [ "www.somedomain.com" ],
    "event" : "checkout",
    "pin_id" : [ "34567" ],
    "campaign_id" : [ "626744528398" ]
  },
  "category" : "DLX Demographics",
  "ad_account_id" : "549755885175"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudiencesApi;

import java.io.File;
import java.util.*;

public class AudiencesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AudienceCreateCustomRequest audienceCreateCustomRequest = ; // AudienceCreateCustomRequest | 

        try {
            Audience result = apiInstance.audiences/createCustom(adAccountId, audienceCreateCustomRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/createCustom");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AudienceCreateCustomRequest audienceCreateCustomRequest = new AudienceCreateCustomRequest(); // AudienceCreateCustomRequest | 

try {
    final result = await api_instance.audiences/createCustom(adAccountId, audienceCreateCustomRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audiences/createCustom: $e\n');
}

import org.openapitools.client.api.AudiencesApi;

public class AudiencesApiExample {
    public static void main(String[] args) {
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AudienceCreateCustomRequest audienceCreateCustomRequest = ; // AudienceCreateCustomRequest | 

        try {
            Audience result = apiInstance.audiences/createCustom(adAccountId, audienceCreateCustomRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/createCustom");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudiencesApi *apiInstance = [[AudiencesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AudienceCreateCustomRequest *audienceCreateCustomRequest = ; // 

// Create custom audience
[apiInstance audiences/createCustomWith:adAccountId
    audienceCreateCustomRequest:audienceCreateCustomRequest
              completionHandler: ^(Audience output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudiencesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var audienceCreateCustomRequest = ; // {AudienceCreateCustomRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audiences/createCustom(adAccountId, audienceCreateCustomRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audiences/createCustomExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudiencesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var audienceCreateCustomRequest = new AudienceCreateCustomRequest(); // AudienceCreateCustomRequest | 

            try {
                // Create custom audience
                Audience result = apiInstance.audiences/createCustom(adAccountId, audienceCreateCustomRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudiencesApi.audiences/createCustom: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudiencesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$audienceCreateCustomRequest = ; // AudienceCreateCustomRequest | 

try {
    $result = $api_instance->audiences/createCustom($adAccountId, $audienceCreateCustomRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->audiences/createCustom: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudiencesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudiencesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $audienceCreateCustomRequest = WWW::OPenAPIClient::Object::AudienceCreateCustomRequest->new(); # AudienceCreateCustomRequest | 

eval {
    my $result = $api_instance->audiences/createCustom(adAccountId => $adAccountId, audienceCreateCustomRequest => $audienceCreateCustomRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudiencesApi->audiences/createCustom: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudiencesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
audienceCreateCustomRequest =  # AudienceCreateCustomRequest | 

try:
    # Create custom audience
    api_response = api_instance.audiences/create_custom(adAccountId, audienceCreateCustomRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudiencesApi->audiences/createCustom: %s\n" % e)
extern crate AudiencesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let audienceCreateCustomRequest = ; // AudienceCreateCustomRequest

    let mut context = AudiencesApi::Context::default();
    let result = client.audiences/createCustom(adAccountId, audienceCreateCustomRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
audienceCreateCustomRequest *

Custom audience to create.

Responses


audiences/get

Get audience

Get a specific audience given the audience ID.


/ad_accounts/{ad_account_id}/audiences/{audience_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/audiences/{audience_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudiencesApi;

import java.io.File;
import java.util.*;

public class AudiencesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String audienceId = audienceId_example; // String | Unique identifier of an audience

        try {
            Audience result = apiInstance.audiences/get(adAccountId, audienceId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String audienceId = new String(); // String | Unique identifier of an audience

try {
    final result = await api_instance.audiences/get(adAccountId, audienceId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audiences/get: $e\n');
}

import org.openapitools.client.api.AudiencesApi;

public class AudiencesApiExample {
    public static void main(String[] args) {
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String audienceId = audienceId_example; // String | Unique identifier of an audience

        try {
            Audience result = apiInstance.audiences/get(adAccountId, audienceId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudiencesApi *apiInstance = [[AudiencesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *audienceId = audienceId_example; // Unique identifier of an audience (default to null)

// Get audience
[apiInstance audiences/getWith:adAccountId
    audienceId:audienceId
              completionHandler: ^(Audience output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudiencesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var audienceId = audienceId_example; // {String} Unique identifier of an audience

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audiences/get(adAccountId, audienceId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audiences/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudiencesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var audienceId = audienceId_example;  // String | Unique identifier of an audience (default to null)

            try {
                // Get audience
                Audience result = apiInstance.audiences/get(adAccountId, audienceId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudiencesApi.audiences/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudiencesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$audienceId = audienceId_example; // String | Unique identifier of an audience

try {
    $result = $api_instance->audiences/get($adAccountId, $audienceId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->audiences/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudiencesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudiencesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $audienceId = audienceId_example; # String | Unique identifier of an audience

eval {
    my $result = $api_instance->audiences/get(adAccountId => $adAccountId, audienceId => $audienceId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudiencesApi->audiences/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudiencesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
audienceId = audienceId_example # String | Unique identifier of an audience (default to null)

try:
    # Get audience
    api_response = api_instance.audiences/get(adAccountId, audienceId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudiencesApi->audiences/get: %s\n" % e)
extern crate AudiencesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let audienceId = audienceId_example; // String

    let mut context = AudiencesApi::Context::default();
    let result = client.audiences/get(adAccountId, audienceId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
audience_id*
String
Unique identifier of an audience
Required

Responses


audiences/list

List audiences

Get list of audiences for the ad account.


/ad_accounts/{ad_account_id}/audiences

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/audiences?bookmark=bookmark_example&order=ASCENDING&page_size=56&ownership_type=OWNED"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudiencesApi;

import java.io.File;
import java.util.*;

public class AudiencesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String ownershipType = OWNED; // String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type.

        try {
            audiences_list_200_response result = apiInstance.audiences/list(adAccountId, bookmark, order, pageSize, ownershipType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String ownershipType = new String(); // String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type.

try {
    final result = await api_instance.audiences/list(adAccountId, bookmark, order, pageSize, ownershipType);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audiences/list: $e\n');
}

import org.openapitools.client.api.AudiencesApi;

public class AudiencesApiExample {
    public static void main(String[] args) {
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String ownershipType = OWNED; // String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type.

        try {
            audiences_list_200_response result = apiInstance.audiences/list(adAccountId, bookmark, order, pageSize, ownershipType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudiencesApi *apiInstance = [[AudiencesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items. (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *ownershipType = OWNED; // This feature is currently in beta and not available to all apps.
Filter audiences by ownership type. (optional) (default to OWNED)

// List audiences
[apiInstance audiences/listWith:adAccountId
    bookmark:bookmark
    order:order
    pageSize:pageSize
    ownershipType:ownershipType
              completionHandler: ^(audiences_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudiencesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items.
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'ownershipType': OWNED // {String} This feature is currently in beta and not available to all apps.
Filter audiences by ownership type.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audiences/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audiences/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudiencesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items. (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var ownershipType = OWNED;  // String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type. (optional)  (default to OWNED)

            try {
                // List audiences
                audiences_list_200_response result = apiInstance.audiences/list(adAccountId, bookmark, order, pageSize, ownershipType);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudiencesApi.audiences/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudiencesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$ownershipType = OWNED; // String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type.

try {
    $result = $api_instance->audiences/list($adAccountId, $bookmark, $order, $pageSize, $ownershipType);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->audiences/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudiencesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudiencesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $ownershipType = OWNED; # String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type.

eval {
    my $result = $api_instance->audiences/list(adAccountId => $adAccountId, bookmark => $bookmark, order => $order, pageSize => $pageSize, ownershipType => $ownershipType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudiencesApi->audiences/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudiencesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID.
For received audiences, it is sorted by sharing event time.
Note that higher-value IDs are associated with more-recently added items. (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
ownershipType = OWNED # String | This feature is currently in beta and not available to all apps.
Filter audiences by ownership type. (optional) (default to OWNED)

try:
    # List audiences
    api_response = api_instance.audiences/list(adAccountId, bookmark=bookmark, order=order, pageSize=pageSize, ownershipType=ownershipType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudiencesApi->audiences/list: %s\n" % e)
extern crate AudiencesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let order = ASCENDING; // String
    let pageSize = 56; // Integer
    let ownershipType = OWNED; // String

    let mut context = AudiencesApi::Context::default();
    let result = client.audiences/list(adAccountId, bookmark, order, pageSize, ownershipType, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. For received audiences, it is sorted by sharing event time. Note that higher-value IDs are associated with more-recently added items.
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
ownership_type
String
<strong>This feature is currently in beta and not available to all apps.</strong> Filter audiences by ownership type.

Responses


audiences/update

Update audience

Update (edit or remove) an existing targeting audience.


/ad_accounts/{ad_account_id}/audiences/{audience_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/audiences/{audience_id}" \
 -d '{
  "operation_type" : "UPDATE",
  "name" : "string",
  "rule" : {
    "country" : "US",
    "visitor_source_id" : "549755885175",
    "prefill" : true,
    "customer_list_id" : "5497558859876",
    "event_source" : {
      "=" : [ "web", "mobile" ]
    },
    "objective_type" : [ "AWARENESS" ],
    "event_data" : {
      "video_title" : "How to style your Parker Boots",
      "page_name" : "Our Favorite Pins on Pinterest.",
      "order_quantity" : 1,
      "property" : "Athleta",
      "currency" : "USD",
      "lead_type" : "Newsletter",
      "promo_code" : "WINTER10",
      "line_items" : {
        "product_id" : 1414,
        "product_variant" : "Red",
        "product_brand" : "Parker",
        "product_price" : "99.99",
        "product_variant_id" : "1414-34832",
        "product_name" : "Parker Boots",
        "product_category" : "Shoes",
        "product_quantity" : 2
      },
      "search_query" : "boots",
      "order_id" : "X-151481",
      "value" : "199.98"
    },
    "seed_id" : [ "2542620639259", "2542620639261" ],
    "url" : [ "url", "url" ],
    "ad_account_id" : "549755885175",
    "ingestion_source" : {
      "=" : [ "tag" ]
    },
    "ad_id" : [ "687201361754" ],
    "retention_days" : 30,
    "engager_type" : 1,
    "engagement_type" : "click",
    "percentage" : 3,
    "engagement_domain" : [ "www.somedomain.com" ],
    "event" : "checkout",
    "pin_id" : [ "34567" ],
    "campaign_id" : [ "626744528398" ]
  },
  "description" : "string",
  "ad_account_id" : "549755885175"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AudiencesApi;

import java.io.File;
import java.util.*;

public class AudiencesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String audienceId = audienceId_example; // String | Unique identifier of an audience
        AudienceUpdateRequest audienceUpdateRequest = ; // AudienceUpdateRequest | 

        try {
            Audience result = apiInstance.audiences/update(adAccountId, audienceId, audienceUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String audienceId = new String(); // String | Unique identifier of an audience
final AudienceUpdateRequest audienceUpdateRequest = new AudienceUpdateRequest(); // AudienceUpdateRequest | 

try {
    final result = await api_instance.audiences/update(adAccountId, audienceId, audienceUpdateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->audiences/update: $e\n');
}

import org.openapitools.client.api.AudiencesApi;

public class AudiencesApiExample {
    public static void main(String[] args) {
        AudiencesApi apiInstance = new AudiencesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String audienceId = audienceId_example; // String | Unique identifier of an audience
        AudienceUpdateRequest audienceUpdateRequest = ; // AudienceUpdateRequest | 

        try {
            Audience result = apiInstance.audiences/update(adAccountId, audienceId, audienceUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AudiencesApi#audiences/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
AudiencesApi *apiInstance = [[AudiencesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *audienceId = audienceId_example; // Unique identifier of an audience (default to null)
AudienceUpdateRequest *audienceUpdateRequest = ; //  (optional)

// Update audience
[apiInstance audiences/updateWith:adAccountId
    audienceId:audienceId
    audienceUpdateRequest:audienceUpdateRequest
              completionHandler: ^(Audience output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.AudiencesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var audienceId = audienceId_example; // {String} Unique identifier of an audience
var opts = {
  'audienceUpdateRequest':  // {AudienceUpdateRequest} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.audiences/update(adAccountId, audienceId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class audiences/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new AudiencesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var audienceId = audienceId_example;  // String | Unique identifier of an audience (default to null)
            var audienceUpdateRequest = new AudienceUpdateRequest(); // AudienceUpdateRequest |  (optional) 

            try {
                // Update audience
                Audience result = apiInstance.audiences/update(adAccountId, audienceId, audienceUpdateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AudiencesApi.audiences/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AudiencesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$audienceId = audienceId_example; // String | Unique identifier of an audience
$audienceUpdateRequest = ; // AudienceUpdateRequest | 

try {
    $result = $api_instance->audiences/update($adAccountId, $audienceId, $audienceUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AudiencesApi->audiences/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AudiencesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AudiencesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $audienceId = audienceId_example; # String | Unique identifier of an audience
my $audienceUpdateRequest = WWW::OPenAPIClient::Object::AudienceUpdateRequest->new(); # AudienceUpdateRequest | 

eval {
    my $result = $api_instance->audiences/update(adAccountId => $adAccountId, audienceId => $audienceId, audienceUpdateRequest => $audienceUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AudiencesApi->audiences/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.AudiencesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
audienceId = audienceId_example # String | Unique identifier of an audience (default to null)
audienceUpdateRequest =  # AudienceUpdateRequest |  (optional)

try:
    # Update audience
    api_response = api_instance.audiences/update(adAccountId, audienceId, audienceUpdateRequest=audienceUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AudiencesApi->audiences/update: %s\n" % e)
extern crate AudiencesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let audienceId = audienceId_example; // String
    let audienceUpdateRequest = ; // AudienceUpdateRequest

    let mut context = AudiencesApi::Context::default();
    let result = client.audiences/update(adAccountId, audienceId, audienceUpdateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
audience_id*
String
Unique identifier of an audience
Required
Body parameters
Name Description
audienceUpdateRequest

The audience to be updated.

Responses


Billing

adsCredit/redeem

Redeem ad credits

Redeem ads credit on behalf of the ad account id and apply it towards billing. <strong>This endpoint might not be available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/ads_credit/redeem

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads_credit/redeem" \
 -d '{
  "validateOnly" : true,
  "offerCodeHash" : "138e9e0ff7e38cf511b880975eb574c09aa9d5e1657590ab0431040da68caa67"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdsCreditRedeemRequest adsCreditRedeemRequest = ; // AdsCreditRedeemRequest | 

        try {
            AdsCreditRedeemResponse result = apiInstance.adsCredit/redeem(adAccountId, adsCreditRedeemRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#adsCredit/redeem");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AdsCreditRedeemRequest adsCreditRedeemRequest = new AdsCreditRedeemRequest(); // AdsCreditRedeemRequest | 

try {
    final result = await api_instance.adsCredit/redeem(adAccountId, adsCreditRedeemRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adsCredit/redeem: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdsCreditRedeemRequest adsCreditRedeemRequest = ; // AdsCreditRedeemRequest | 

        try {
            AdsCreditRedeemResponse result = apiInstance.adsCredit/redeem(adAccountId, adsCreditRedeemRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#adsCredit/redeem");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AdsCreditRedeemRequest *adsCreditRedeemRequest = ; // 

// Redeem ad credits
[apiInstance adsCredit/redeemWith:adAccountId
    adsCreditRedeemRequest:adsCreditRedeemRequest
              completionHandler: ^(AdsCreditRedeemResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adsCreditRedeemRequest = ; // {AdsCreditRedeemRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adsCredit/redeem(adAccountId, adsCreditRedeemRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adsCredit/redeemExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adsCreditRedeemRequest = new AdsCreditRedeemRequest(); // AdsCreditRedeemRequest | 

            try {
                // Redeem ad credits
                AdsCreditRedeemResponse result = apiInstance.adsCredit/redeem(adAccountId, adsCreditRedeemRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.adsCredit/redeem: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adsCreditRedeemRequest = ; // AdsCreditRedeemRequest | 

try {
    $result = $api_instance->adsCredit/redeem($adAccountId, $adsCreditRedeemRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->adsCredit/redeem: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adsCreditRedeemRequest = WWW::OPenAPIClient::Object::AdsCreditRedeemRequest->new(); # AdsCreditRedeemRequest | 

eval {
    my $result = $api_instance->adsCredit/redeem(adAccountId => $adAccountId, adsCreditRedeemRequest => $adsCreditRedeemRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->adsCredit/redeem: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adsCreditRedeemRequest =  # AdsCreditRedeemRequest | 

try:
    # Redeem ad credits
    api_response = api_instance.ads_credit/redeem(adAccountId, adsCreditRedeemRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->adsCredit/redeem: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adsCreditRedeemRequest = ; // AdsCreditRedeemRequest

    let mut context = BillingApi::Context::default();
    let result = client.adsCredit/redeem(adAccountId, adsCreditRedeemRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.
billing:write Create, update, or delete billing data, billing profiles, etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adsCreditRedeemRequest *

Redeem ad credits request.

Responses


adsCreditsDiscounts/get

Get ads credit discounts

Returns the list of discounts applied to the account. <strong>This endpoint might not be available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/ads_credit/discounts

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ads_credit/discounts?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            ads_credits_discounts_get_200_response result = apiInstance.adsCreditsDiscounts/get(adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#adsCreditsDiscounts/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.adsCreditsDiscounts/get(adAccountId, bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adsCreditsDiscounts/get: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            ads_credits_discounts_get_200_response result = apiInstance.adsCreditsDiscounts/get(adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#adsCreditsDiscounts/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// Get ads credit discounts
[apiInstance adsCreditsDiscounts/getWith:adAccountId
    bookmark:bookmark
    pageSize:pageSize
              completionHandler: ^(ads_credits_discounts_get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adsCreditsDiscounts/get(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adsCreditsDiscounts/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // Get ads credit discounts
                ads_credits_discounts_get_200_response result = apiInstance.adsCreditsDiscounts/get(adAccountId, bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.adsCreditsDiscounts/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->adsCreditsDiscounts/get($adAccountId, $bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->adsCreditsDiscounts/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->adsCreditsDiscounts/get(adAccountId => $adAccountId, bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->adsCreditsDiscounts/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # Get ads credit discounts
    api_response = api_instance.ads_credits_discounts/get(adAccountId, bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->adsCreditsDiscounts/get: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = BillingApi::Context::default();
    let result = client.adsCreditsDiscounts/get(adAccountId, bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.
billing:read See all of your billing data, billing profile, etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


billingProfiles/get

Get billing profiles

Get billing profiles in the advertiser account. <strong>This endpoint might not be available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/billing_profiles

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/billing_profiles?is_active=true&bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Boolean isActive = true; // Boolean | Return active billing profiles, if false return all billing profiles.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            billing_profiles_get_200_response result = apiInstance.billingProfiles/get(adAccountId, isActive, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#billingProfiles/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Boolean isActive = new Boolean(); // Boolean | Return active billing profiles, if false return all billing profiles.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.billingProfiles/get(adAccountId, isActive, bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->billingProfiles/get: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Boolean isActive = true; // Boolean | Return active billing profiles, if false return all billing profiles.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            billing_profiles_get_200_response result = apiInstance.billingProfiles/get(adAccountId, isActive, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#billingProfiles/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Boolean *isActive = true; // Return active billing profiles, if false return all billing profiles. (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// Get billing profiles
[apiInstance billingProfiles/getWith:adAccountId
    isActive:isActive
    bookmark:bookmark
    pageSize:pageSize
              completionHandler: ^(billing_profiles_get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var isActive = true; // {Boolean} Return active billing profiles, if false return all billing profiles.
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.billingProfiles/get(adAccountId, isActive, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class billingProfiles/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var isActive = true;  // Boolean | Return active billing profiles, if false return all billing profiles. (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // Get billing profiles
                billing_profiles_get_200_response result = apiInstance.billingProfiles/get(adAccountId, isActive, bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.billingProfiles/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$isActive = true; // Boolean | Return active billing profiles, if false return all billing profiles.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->billingProfiles/get($adAccountId, $isActive, $bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->billingProfiles/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $isActive = true; # Boolean | Return active billing profiles, if false return all billing profiles.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->billingProfiles/get(adAccountId => $adAccountId, isActive => $isActive, bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->billingProfiles/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
isActive = true # Boolean | Return active billing profiles, if false return all billing profiles. (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # Get billing profiles
    api_response = api_instance.billing_profiles/get(adAccountId, isActive, bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->billingProfiles/get: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let isActive = true; // Boolean
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = BillingApi::Context::default();
    let result = client.billingProfiles/get(adAccountId, isActive, bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.
billing:read See all of your billing data, billing profile, etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
is_active*
Boolean
Return active billing profiles, if false return all billing profiles.
Required
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


ssioAccounts/get

Get Salesforce account details including bill-to information.

Get Salesforce account details including bill-to information to be used in insertion orders process for <code>ad_account_id</code>. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Finance, Campaign.


/ad_accounts/{ad_account_id}/ssio/accounts

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ssio/accounts"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            SSIOAccountResponse result = apiInstance.ssioAccounts/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioAccounts/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.ssioAccounts/get(adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ssioAccounts/get: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            SSIOAccountResponse result = apiInstance.ssioAccounts/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioAccounts/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)

// Get Salesforce account details including bill-to information.
[apiInstance ssioAccounts/getWith:adAccountId
              completionHandler: ^(SSIOAccountResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ssioAccounts/get(adAccountId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ssioAccounts/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)

            try {
                // Get Salesforce account details including bill-to information.
                SSIOAccountResponse result = apiInstance.ssioAccounts/get(adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.ssioAccounts/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->ssioAccounts/get($adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->ssioAccounts/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->ssioAccounts/get(adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->ssioAccounts/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)

try:
    # Get Salesforce account details including bill-to information.
    api_response = api_instance.ssio_accounts/get(adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->ssioAccounts/get: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String

    let mut context = BillingApi::Context::default();
    let result = client.ssioAccounts/get(adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required

Responses


ssioInsertionOrder/create

Create insertion order through SSIO.

Create insertion order through SSIO for <code>ad_account_id</code>. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Finance, Campaign.


/ad_accounts/{ad_account_id}/ssio/insertion_orders

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ssio/insertion_orders" \
 -d '{
  "end_date" : "2020-12-20",
  "billto_company_id" : "billto_company_id",
  "billing_contact_firstname" : "billing_contact_firstname",
  "user_email" : "test@example",
  "order_line_type" : "BUDGET",
  "currency_info" : "USD",
  "billing_contact_email" : "test@example",
  "estimated_monthly_spend" : 6.027456183070403,
  "media_contact_email" : "test@example",
  "billing_contact_lastname" : "billing_contact_lastname",
  "order_name" : "order_name",
  "po_number" : "po_number",
  "agency_link" : "agency_link",
  "pmp_id" : "pmp_id",
  "accepted_terms_id" : "accepted_terms_id",
  "accepted_terms_time" : 0,
  "media_contact_lastname" : "media_contact_lastname",
  "start_date" : "2020-12-20",
  "budget_amount" : 5000000,
  "media_contact_firstname" : "media_contact_firstname",
  "billto_business_address_id" : "billto_business_address_id",
  "billto_billing_address_id" : "billto_billing_address_id"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        SSIOCreateInsertionOrderRequest sSIOCreateInsertionOrderRequest = ; // SSIOCreateInsertionOrderRequest | 

        try {
            SSIOCreateInsertionOrderResponse result = apiInstance.ssioInsertionOrder/create(adAccountId, sSIOCreateInsertionOrderRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrder/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final SSIOCreateInsertionOrderRequest sSIOCreateInsertionOrderRequest = new SSIOCreateInsertionOrderRequest(); // SSIOCreateInsertionOrderRequest | 

try {
    final result = await api_instance.ssioInsertionOrder/create(adAccountId, sSIOCreateInsertionOrderRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ssioInsertionOrder/create: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        SSIOCreateInsertionOrderRequest sSIOCreateInsertionOrderRequest = ; // SSIOCreateInsertionOrderRequest | 

        try {
            SSIOCreateInsertionOrderResponse result = apiInstance.ssioInsertionOrder/create(adAccountId, sSIOCreateInsertionOrderRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrder/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
SSIOCreateInsertionOrderRequest *sSIOCreateInsertionOrderRequest = ; // 

// Create insertion order through SSIO.
[apiInstance ssioInsertionOrder/createWith:adAccountId
    sSIOCreateInsertionOrderRequest:sSIOCreateInsertionOrderRequest
              completionHandler: ^(SSIOCreateInsertionOrderResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var sSIOCreateInsertionOrderRequest = ; // {SSIOCreateInsertionOrderRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ssioInsertionOrder/create(adAccountId, sSIOCreateInsertionOrderRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ssioInsertionOrder/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var sSIOCreateInsertionOrderRequest = new SSIOCreateInsertionOrderRequest(); // SSIOCreateInsertionOrderRequest | 

            try {
                // Create insertion order through SSIO.
                SSIOCreateInsertionOrderResponse result = apiInstance.ssioInsertionOrder/create(adAccountId, sSIOCreateInsertionOrderRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.ssioInsertionOrder/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$sSIOCreateInsertionOrderRequest = ; // SSIOCreateInsertionOrderRequest | 

try {
    $result = $api_instance->ssioInsertionOrder/create($adAccountId, $sSIOCreateInsertionOrderRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->ssioInsertionOrder/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $sSIOCreateInsertionOrderRequest = WWW::OPenAPIClient::Object::SSIOCreateInsertionOrderRequest->new(); # SSIOCreateInsertionOrderRequest | 

eval {
    my $result = $api_instance->ssioInsertionOrder/create(adAccountId => $adAccountId, sSIOCreateInsertionOrderRequest => $sSIOCreateInsertionOrderRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->ssioInsertionOrder/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
sSIOCreateInsertionOrderRequest =  # SSIOCreateInsertionOrderRequest | 

try:
    # Create insertion order through SSIO.
    api_response = api_instance.ssio_insertion_order/create(adAccountId, sSIOCreateInsertionOrderRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->ssioInsertionOrder/create: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let sSIOCreateInsertionOrderRequest = ; // SSIOCreateInsertionOrderRequest

    let mut context = BillingApi::Context::default();
    let result = client.ssioInsertionOrder/create(adAccountId, sSIOCreateInsertionOrderRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
sSIOCreateInsertionOrderRequest *

Order line to create.

Responses


ssioInsertionOrder/edit

Edit insertion order through SSIO.

Edit insertion order through SSIO for <code>ad_account_id</code>. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Finance, Campaign.


/ad_accounts/{ad_account_id}/ssio/insertion_orders

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ssio/insertion_orders" \
 -d '{
  "end_date" : "2020-12-20",
  "salesforce_order_line_id" : "salesforce_order_line_id",
  "billing_contact_firstname" : "billing_contact_firstname",
  "user_email" : "test@example",
  "ads_manager_order_line_id" : "ads_manager_order_line_id",
  "billing_contact_email" : "test@example",
  "media_contact_email" : "test@example",
  "billing_contact_lastname" : "billing_contact_lastname",
  "salesforce_order_id" : "salesforce_order_id",
  "po_number" : "po_number",
  "agency_link" : "agency_link",
  "media_contact_lastname" : "media_contact_lastname",
  "start_date" : "2020-12-20",
  "budget_amount" : 5000000,
  "media_contact_firstname" : "media_contact_firstname",
  "oracle_line_id" : "oracle_line_id"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        SSIOEditInsertionOrderRequest sSIOEditInsertionOrderRequest = ; // SSIOEditInsertionOrderRequest | 

        try {
            SSIOEditInsertionOrderResponse result = apiInstance.ssioInsertionOrder/edit(adAccountId, sSIOEditInsertionOrderRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrder/edit");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final SSIOEditInsertionOrderRequest sSIOEditInsertionOrderRequest = new SSIOEditInsertionOrderRequest(); // SSIOEditInsertionOrderRequest | 

try {
    final result = await api_instance.ssioInsertionOrder/edit(adAccountId, sSIOEditInsertionOrderRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ssioInsertionOrder/edit: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        SSIOEditInsertionOrderRequest sSIOEditInsertionOrderRequest = ; // SSIOEditInsertionOrderRequest | 

        try {
            SSIOEditInsertionOrderResponse result = apiInstance.ssioInsertionOrder/edit(adAccountId, sSIOEditInsertionOrderRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrder/edit");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
SSIOEditInsertionOrderRequest *sSIOEditInsertionOrderRequest = ; // 

// Edit insertion order through SSIO.
[apiInstance ssioInsertionOrder/editWith:adAccountId
    sSIOEditInsertionOrderRequest:sSIOEditInsertionOrderRequest
              completionHandler: ^(SSIOEditInsertionOrderResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var sSIOEditInsertionOrderRequest = ; // {SSIOEditInsertionOrderRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ssioInsertionOrder/edit(adAccountId, sSIOEditInsertionOrderRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ssioInsertionOrder/editExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var sSIOEditInsertionOrderRequest = new SSIOEditInsertionOrderRequest(); // SSIOEditInsertionOrderRequest | 

            try {
                // Edit insertion order through SSIO.
                SSIOEditInsertionOrderResponse result = apiInstance.ssioInsertionOrder/edit(adAccountId, sSIOEditInsertionOrderRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.ssioInsertionOrder/edit: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$sSIOEditInsertionOrderRequest = ; // SSIOEditInsertionOrderRequest | 

try {
    $result = $api_instance->ssioInsertionOrder/edit($adAccountId, $sSIOEditInsertionOrderRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->ssioInsertionOrder/edit: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $sSIOEditInsertionOrderRequest = WWW::OPenAPIClient::Object::SSIOEditInsertionOrderRequest->new(); # SSIOEditInsertionOrderRequest | 

eval {
    my $result = $api_instance->ssioInsertionOrder/edit(adAccountId => $adAccountId, sSIOEditInsertionOrderRequest => $sSIOEditInsertionOrderRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->ssioInsertionOrder/edit: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
sSIOEditInsertionOrderRequest =  # SSIOEditInsertionOrderRequest | 

try:
    # Edit insertion order through SSIO.
    api_response = api_instance.ssio_insertion_order/edit(adAccountId, sSIOEditInsertionOrderRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->ssioInsertionOrder/edit: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let sSIOEditInsertionOrderRequest = ; // SSIOEditInsertionOrderRequest

    let mut context = BillingApi::Context::default();
    let result = client.ssioInsertionOrder/edit(adAccountId, sSIOEditInsertionOrderRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
sSIOEditInsertionOrderRequest *

Order line to create.

Responses


ssioInsertionOrdersStatus/getByAdAccount

Get insertion order status by ad account id.

Get insertion order status for account id <code>ad_account_id</code>. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Finance, Campaign.


/ad_accounts/{ad_account_id}/ssio/insertion_orders/status

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ssio/insertion_orders/status?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            ssio_insertion_orders_status_get_by_ad_account_200_response result = apiInstance.ssioInsertionOrdersStatus/getByAdAccount(adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrdersStatus/getByAdAccount");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.ssioInsertionOrdersStatus/getByAdAccount(adAccountId, bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ssioInsertionOrdersStatus/getByAdAccount: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            ssio_insertion_orders_status_get_by_ad_account_200_response result = apiInstance.ssioInsertionOrdersStatus/getByAdAccount(adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrdersStatus/getByAdAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// Get insertion order status by ad account id.
[apiInstance ssioInsertionOrdersStatus/getByAdAccountWith:adAccountId
    bookmark:bookmark
    pageSize:pageSize
              completionHandler: ^(ssio_insertion_orders_status_get_by_ad_account_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ssioInsertionOrdersStatus/getByAdAccount(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ssioInsertionOrdersStatus/getByAdAccountExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // Get insertion order status by ad account id.
                ssio_insertion_orders_status_get_by_ad_account_200_response result = apiInstance.ssioInsertionOrdersStatus/getByAdAccount(adAccountId, bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.ssioInsertionOrdersStatus/getByAdAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->ssioInsertionOrdersStatus/getByAdAccount($adAccountId, $bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->ssioInsertionOrdersStatus/getByAdAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->ssioInsertionOrdersStatus/getByAdAccount(adAccountId => $adAccountId, bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->ssioInsertionOrdersStatus/getByAdAccount: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # Get insertion order status by ad account id.
    api_response = api_instance.ssio_insertion_orders_status/get_by_ad_account(adAccountId, bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->ssioInsertionOrdersStatus/getByAdAccount: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = BillingApi::Context::default();
    let result = client.ssioInsertionOrdersStatus/getByAdAccount(adAccountId, bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


ssioInsertionOrdersStatus/getByPinOrderId

Get insertion order status by pin order id.

Get insertion order status for pin order id <code>pin_order_id</code>. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Finance, Campaign.


/ad_accounts/{ad_account_id}/ssio/insertion_orders/{pin_order_id}/status

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ssio/insertion_orders/{pin_order_id}/status"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String pinOrderId = 0Q01N0000015hekSVDFDC; // String | The pin order id associated with the ssio insertion order

        try {
            SSIOInsertionOrderStatusResponse result = apiInstance.ssioInsertionOrdersStatus/getByPinOrderId(adAccountId, pinOrderId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrdersStatus/getByPinOrderId");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String pinOrderId = new String(); // String | The pin order id associated with the ssio insertion order

try {
    final result = await api_instance.ssioInsertionOrdersStatus/getByPinOrderId(adAccountId, pinOrderId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ssioInsertionOrdersStatus/getByPinOrderId: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String pinOrderId = 0Q01N0000015hekSVDFDC; // String | The pin order id associated with the ssio insertion order

        try {
            SSIOInsertionOrderStatusResponse result = apiInstance.ssioInsertionOrdersStatus/getByPinOrderId(adAccountId, pinOrderId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioInsertionOrdersStatus/getByPinOrderId");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *pinOrderId = 0Q01N0000015hekSVDFDC; // The pin order id associated with the ssio insertion order (default to null)

// Get insertion order status by pin order id.
[apiInstance ssioInsertionOrdersStatus/getByPinOrderIdWith:adAccountId
    pinOrderId:pinOrderId
              completionHandler: ^(SSIOInsertionOrderStatusResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var pinOrderId = 0Q01N0000015hekSVDFDC; // {String} The pin order id associated with the ssio insertion order

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ssioInsertionOrdersStatus/getByPinOrderId(adAccountId, pinOrderId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ssioInsertionOrdersStatus/getByPinOrderIdExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pinOrderId = 0Q01N0000015hekSVDFDC;  // String | The pin order id associated with the ssio insertion order (default to null)

            try {
                // Get insertion order status by pin order id.
                SSIOInsertionOrderStatusResponse result = apiInstance.ssioInsertionOrdersStatus/getByPinOrderId(adAccountId, pinOrderId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.ssioInsertionOrdersStatus/getByPinOrderId: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pinOrderId = 0Q01N0000015hekSVDFDC; // String | The pin order id associated with the ssio insertion order

try {
    $result = $api_instance->ssioInsertionOrdersStatus/getByPinOrderId($adAccountId, $pinOrderId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->ssioInsertionOrdersStatus/getByPinOrderId: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pinOrderId = 0Q01N0000015hekSVDFDC; # String | The pin order id associated with the ssio insertion order

eval {
    my $result = $api_instance->ssioInsertionOrdersStatus/getByPinOrderId(adAccountId => $adAccountId, pinOrderId => $pinOrderId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->ssioInsertionOrdersStatus/getByPinOrderId: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pinOrderId = 0Q01N0000015hekSVDFDC # String | The pin order id associated with the ssio insertion order (default to null)

try:
    # Get insertion order status by pin order id.
    api_response = api_instance.ssio_insertion_orders_status/get_by_pin_order_id(adAccountId, pinOrderId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->ssioInsertionOrdersStatus/getByPinOrderId: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pinOrderId = 0Q01N0000015hekSVDFDC; // String

    let mut context = BillingApi::Context::default();
    let result = client.ssioInsertionOrdersStatus/getByPinOrderId(adAccountId, pinOrderId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
pin_order_id*
String
The pin order id associated with the ssio insertion order
Required

Responses


ssioOrderLines/getByAdAccount

Get Salesforce order lines by ad account id.

Get Salesforce order lines for account id <code>ad_account_id</code>. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Finance, Campaign.


/ad_accounts/{ad_account_id}/ssio/order_lines

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/ssio/order_lines?bookmark=bookmark_example&page_size=56&pin_order_id=0Q01N0000015hekSVDFDC"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BillingApi;

import java.io.File;
import java.util.*;

public class BillingApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String pinOrderId = 0Q01N0000015hekSVDFDC; // String | The pin order id associated with the ssio insertino order

        try {
            ssio_order_lines_get_by_ad_account_200_response result = apiInstance.ssioOrderLines/getByAdAccount(adAccountId, bookmark, pageSize, pinOrderId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioOrderLines/getByAdAccount");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String pinOrderId = new String(); // String | The pin order id associated with the ssio insertino order

try {
    final result = await api_instance.ssioOrderLines/getByAdAccount(adAccountId, bookmark, pageSize, pinOrderId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ssioOrderLines/getByAdAccount: $e\n');
}

import org.openapitools.client.api.BillingApi;

public class BillingApiExample {
    public static void main(String[] args) {
        BillingApi apiInstance = new BillingApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String pinOrderId = 0Q01N0000015hekSVDFDC; // String | The pin order id associated with the ssio insertino order

        try {
            ssio_order_lines_get_by_ad_account_200_response result = apiInstance.ssioOrderLines/getByAdAccount(adAccountId, bookmark, pageSize, pinOrderId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#ssioOrderLines/getByAdAccount");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BillingApi *apiInstance = [[BillingApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *pinOrderId = 0Q01N0000015hekSVDFDC; // The pin order id associated with the ssio insertino order (optional) (default to null)

// Get Salesforce order lines by ad account id.
[apiInstance ssioOrderLines/getByAdAccountWith:adAccountId
    bookmark:bookmark
    pageSize:pageSize
    pinOrderId:pinOrderId
              completionHandler: ^(ssio_order_lines_get_by_ad_account_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BillingApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'pinOrderId': 0Q01N0000015hekSVDFDC // {String} The pin order id associated with the ssio insertino order
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ssioOrderLines/getByAdAccount(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ssioOrderLines/getByAdAccountExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BillingApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var pinOrderId = 0Q01N0000015hekSVDFDC;  // String | The pin order id associated with the ssio insertino order (optional)  (default to null)

            try {
                // Get Salesforce order lines by ad account id.
                ssio_order_lines_get_by_ad_account_200_response result = apiInstance.ssioOrderLines/getByAdAccount(adAccountId, bookmark, pageSize, pinOrderId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BillingApi.ssioOrderLines/getByAdAccount: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BillingApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$pinOrderId = 0Q01N0000015hekSVDFDC; // String | The pin order id associated with the ssio insertino order

try {
    $result = $api_instance->ssioOrderLines/getByAdAccount($adAccountId, $bookmark, $pageSize, $pinOrderId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BillingApi->ssioOrderLines/getByAdAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BillingApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BillingApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $pinOrderId = 0Q01N0000015hekSVDFDC; # String | The pin order id associated with the ssio insertino order

eval {
    my $result = $api_instance->ssioOrderLines/getByAdAccount(adAccountId => $adAccountId, bookmark => $bookmark, pageSize => $pageSize, pinOrderId => $pinOrderId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BillingApi->ssioOrderLines/getByAdAccount: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BillingApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
pinOrderId = 0Q01N0000015hekSVDFDC # String | The pin order id associated with the ssio insertino order (optional) (default to null)

try:
    # Get Salesforce order lines by ad account id.
    api_response = api_instance.ssio_order_lines/get_by_ad_account(adAccountId, bookmark=bookmark, pageSize=pageSize, pinOrderId=pinOrderId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BillingApi->ssioOrderLines/getByAdAccount: %s\n" % e)
extern crate BillingApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let pinOrderId = 0Q01N0000015hekSVDFDC; // String

    let mut context = BillingApi::Context::default();
    let result = client.ssioOrderLines/getByAdAccount(adAccountId, bookmark, pageSize, pinOrderId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
pin_order_id
String
The pin order id associated with the ssio insertino order

Responses


Boards

boardSections/create

Create board section

Create a board section on a board owned by the "operation user_account" - or on a group board that has been shared with this account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}/sections

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}/sections?ad_account_id=adAccountId_example" \
 -d '{
  "name" : "Salads",
  "id" : "549755885175"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        BoardSection boardSection = ; // BoardSection | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            BoardSection result = apiInstance.boardSections/create(boardId, boardSection, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final BoardSection boardSection = new BoardSection(); // BoardSection | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boardSections/create(boardId, boardSection, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boardSections/create: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        BoardSection boardSection = ; // BoardSection | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            BoardSection result = apiInstance.boardSections/create(boardId, boardSection, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
BoardSection *boardSection = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Create board section
[apiInstance boardSections/createWith:boardId
    boardSection:boardSection
    adAccountId:adAccountId
              completionHandler: ^(BoardSection output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var boardSection = ; // {BoardSection} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boardSections/create(boardId, boardSection, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boardSections/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var boardSection = new BoardSection(); // BoardSection | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Create board section
                BoardSection result = apiInstance.boardSections/create(boardId, boardSection, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boardSections/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$boardSection = ; // BoardSection | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->boardSections/create($boardId, $boardSection, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boardSections/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $boardSection = WWW::OPenAPIClient::Object::BoardSection->new(); # BoardSection | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->boardSections/create(boardId => $boardId, boardSection => $boardSection, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boardSections/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
boardSection =  # BoardSection | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Create board section
    api_response = api_instance.board_sections/create(boardId, boardSection, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boardSections/create: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let boardSection = ; // BoardSection
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boardSections/create(boardId, boardSection, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
Body parameters
Name Description
boardSection *

Create a board section.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


boardSections/delete

Delete board section

Delete a board section on a board owned by the "operation user_account" - or on a group board that has been shared with this account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}/sections/{section_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}/sections/{section_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String sectionId = sectionId_example; // String | Unique identifier of a board section.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.boardSections/delete(boardId, sectionId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String sectionId = new String(); // String | Unique identifier of a board section.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boardSections/delete(boardId, sectionId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boardSections/delete: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String sectionId = sectionId_example; // String | Unique identifier of a board section.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.boardSections/delete(boardId, sectionId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *sectionId = sectionId_example; // Unique identifier of a board section. (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Delete board section
[apiInstance boardSections/deleteWith:boardId
    sectionId:sectionId
    adAccountId:adAccountId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var sectionId = sectionId_example; // {String} Unique identifier of a board section.
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.boardSections/delete(boardId, sectionId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boardSections/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var sectionId = sectionId_example;  // String | Unique identifier of a board section. (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Delete board section
                apiInstance.boardSections/delete(boardId, sectionId, adAccountId);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boardSections/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$sectionId = sectionId_example; // String | Unique identifier of a board section.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $api_instance->boardSections/delete($boardId, $sectionId, $adAccountId);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boardSections/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $sectionId = sectionId_example; # String | Unique identifier of a board section.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    $api_instance->boardSections/delete(boardId => $boardId, sectionId => $sectionId, adAccountId => $adAccountId);
};
if ($@) {
    warn "Exception when calling BoardsApi->boardSections/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
sectionId = sectionId_example # String | Unique identifier of a board section. (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Delete board section
    api_instance.board_sections/delete(boardId, sectionId, adAccountId=adAccountId)
except ApiException as e:
    print("Exception when calling BoardsApi->boardSections/delete: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let sectionId = sectionId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boardSections/delete(boardId, sectionId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
section_id*
String
Unique identifier of a board section.
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


boardSections/list

List board sections

Get a list of all board sections from a board owned by the "operation user_account" - or a group board that has been shared with this account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}/sections

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}/sections?ad_account_id=adAccountId_example&bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            board_sections_list_200_response result = apiInstance.boardSections/list(boardId, adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.boardSections/list(boardId, adAccountId, bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boardSections/list: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            board_sections_list_200_response result = apiInstance.boardSections/list(boardId, adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// List board sections
[apiInstance boardSections/listWith:boardId
    adAccountId:adAccountId
    bookmark:bookmark
    pageSize:pageSize
              completionHandler: ^(board_sections_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var opts = {
  'adAccountId': adAccountId_example, // {String} Unique identifier of an ad account.
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boardSections/list(boardId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boardSections/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // List board sections
                board_sections_list_200_response result = apiInstance.boardSections/list(boardId, adAccountId, bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boardSections/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->boardSections/list($boardId, $adAccountId, $bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boardSections/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->boardSections/list(boardId => $boardId, adAccountId => $adAccountId, bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boardSections/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # List board sections
    api_response = api_instance.board_sections/list(boardId, adAccountId=adAccountId, bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boardSections/list: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = BoardsApi::Context::default();
    let result = client.boardSections/list(boardId, adAccountId, bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


boardSections/listPins

List Pins on board section

Get a list of the Pins on a board section of a board owned by the "operation user_account" - or on a group board that has been shared with this account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}/sections/{section_id}/pins

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}/sections/{section_id}/pins?ad_account_id=adAccountId_example&bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String sectionId = sectionId_example; // String | Unique identifier of a board section.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            boards_list_pins_200_response result = apiInstance.boardSections/listPins(boardId, sectionId, adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/listPins");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String sectionId = new String(); // String | Unique identifier of a board section.
final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.boardSections/listPins(boardId, sectionId, adAccountId, bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boardSections/listPins: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String sectionId = sectionId_example; // String | Unique identifier of a board section.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            boards_list_pins_200_response result = apiInstance.boardSections/listPins(boardId, sectionId, adAccountId, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/listPins");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *sectionId = sectionId_example; // Unique identifier of a board section. (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// List Pins on board section
[apiInstance boardSections/listPinsWith:boardId
    sectionId:sectionId
    adAccountId:adAccountId
    bookmark:bookmark
    pageSize:pageSize
              completionHandler: ^(boards_list_pins_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var sectionId = sectionId_example; // {String} Unique identifier of a board section.
var opts = {
  'adAccountId': adAccountId_example, // {String} Unique identifier of an ad account.
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boardSections/listPins(boardId, sectionId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boardSections/listPinsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var sectionId = sectionId_example;  // String | Unique identifier of a board section. (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // List Pins on board section
                boards_list_pins_200_response result = apiInstance.boardSections/listPins(boardId, sectionId, adAccountId, bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boardSections/listPins: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$sectionId = sectionId_example; // String | Unique identifier of a board section.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->boardSections/listPins($boardId, $sectionId, $adAccountId, $bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boardSections/listPins: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $sectionId = sectionId_example; # String | Unique identifier of a board section.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->boardSections/listPins(boardId => $boardId, sectionId => $sectionId, adAccountId => $adAccountId, bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boardSections/listPins: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
sectionId = sectionId_example # String | Unique identifier of a board section. (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # List Pins on board section
    api_response = api_instance.board_sections/list_pins(boardId, sectionId, adAccountId=adAccountId, bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boardSections/listPins: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let sectionId = sectionId_example; // String
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = BoardsApi::Context::default();
    let result = client.boardSections/listPins(boardId, sectionId, adAccountId, bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
pins:read See your public Pins

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
section_id*
String
Unique identifier of a board section.
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


boardSections/update

Update board section

Update a board section on a board owned by the "operation user_account" - or on a group board that has been shared with this account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}/sections/{section_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}/sections/{section_id}?ad_account_id=adAccountId_example" \
 -d '{
  "name" : "Salads",
  "id" : "549755885175"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String sectionId = sectionId_example; // String | Unique identifier of a board section.
        BoardSection boardSection = ; // BoardSection | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            BoardSection result = apiInstance.boardSections/update(boardId, sectionId, boardSection, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String sectionId = new String(); // String | Unique identifier of a board section.
final BoardSection boardSection = new BoardSection(); // BoardSection | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boardSections/update(boardId, sectionId, boardSection, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boardSections/update: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String sectionId = sectionId_example; // String | Unique identifier of a board section.
        BoardSection boardSection = ; // BoardSection | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            BoardSection result = apiInstance.boardSections/update(boardId, sectionId, boardSection, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boardSections/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *sectionId = sectionId_example; // Unique identifier of a board section. (default to null)
BoardSection *boardSection = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Update board section
[apiInstance boardSections/updateWith:boardId
    sectionId:sectionId
    boardSection:boardSection
    adAccountId:adAccountId
              completionHandler: ^(BoardSection output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var sectionId = sectionId_example; // {String} Unique identifier of a board section.
var boardSection = ; // {BoardSection} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boardSections/update(boardId, sectionId, boardSection, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boardSections/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var sectionId = sectionId_example;  // String | Unique identifier of a board section. (default to null)
            var boardSection = new BoardSection(); // BoardSection | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Update board section
                BoardSection result = apiInstance.boardSections/update(boardId, sectionId, boardSection, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boardSections/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$sectionId = sectionId_example; // String | Unique identifier of a board section.
$boardSection = ; // BoardSection | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->boardSections/update($boardId, $sectionId, $boardSection, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boardSections/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $sectionId = sectionId_example; # String | Unique identifier of a board section.
my $boardSection = WWW::OPenAPIClient::Object::BoardSection->new(); # BoardSection | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->boardSections/update(boardId => $boardId, sectionId => $sectionId, boardSection => $boardSection, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boardSections/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
sectionId = sectionId_example # String | Unique identifier of a board section. (default to null)
boardSection =  # BoardSection | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Update board section
    api_response = api_instance.board_sections/update(boardId, sectionId, boardSection, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boardSections/update: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let sectionId = sectionId_example; // String
    let boardSection = ; // BoardSection
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boardSections/update(boardId, sectionId, boardSection, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
section_id*
String
Unique identifier of a board section.
Required
Body parameters
Name Description
boardSection *

Update a board section.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


boards/create

Create board

Create a board owned by the "operation user_account". Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/boards?ad_account_id=adAccountId_example" \
 -d '{
  "owner" : {
    "username" : "username"
  },
  "board_pins_modified_at" : "2020-01-01T20:10:40Z",
  "name" : "Summer Recipes",
  "pin_count" : 5,
  "created_at" : "2020-01-01T20:10:40Z",
  "description" : "My favorite summer recipes",
  "collaborator_count" : 17,
  "privacy" : "PUBLIC",
  "id" : "549755885175",
  "media" : {
    "pin_thumbnail_urls" : [ "https://i.pinimg.com/150x150/b4/57/10/b45710f1ede96af55230f4b43935c4af.jpg", "https://i.pinimg.com/150x150/dd/ff/46/ddff4616e39c1935cd05738794fa860e.jpg", "https://i.pinimg.com/150x150/84/ac/59/84ac59b670ccb5b903dace480a98930c.jpg", "https://i.pinimg.com/150x150/4c/54/6f/4c546f521be85e30838fb742bfff6936.jpg" ],
    "image_cover_url" : "https://i.pinimg.com/400x300/fd/cd/d5/fdcdd5a6d8a80824add0d054125cd957.jpg"
  },
  "follower_count" : 13
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        Board board = ; // Board | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Board result = apiInstance.boards/create(board, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final Board board = new Board(); // Board | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boards/create(board, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boards/create: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        Board board = ; // Board | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Board result = apiInstance.boards/create(board, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
Board *board = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Create board
[apiInstance boards/createWith:board
    adAccountId:adAccountId
              completionHandler: ^(Board output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var board = ; // {Board} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boards/create(board, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boards/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var board = new Board(); // Board | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Create board
                Board result = apiInstance.boards/create(board, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boards/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$board = ; // Board | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->boards/create($board, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boards/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $board = WWW::OPenAPIClient::Object::Board->new(); # Board | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->boards/create(board => $board, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boards/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
board =  # Board | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Create board
    api_response = api_instance.boards/create(board, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boards/create: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let board = ; // Board
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boards/create(board, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards

Parameters

Body parameters
Name Description
board *

Create a board using a single board json object.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


boards/delete

Delete board

Delete a board owned by the "operation user_account". - Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.boards/delete(boardId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boards/delete(boardId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boards/delete: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.boards/delete(boardId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Delete board
[apiInstance boards/deleteWith:boardId
    adAccountId:adAccountId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.boards/delete(boardId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boards/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Delete board
                apiInstance.boards/delete(boardId, adAccountId);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boards/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $api_instance->boards/delete($boardId, $adAccountId);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boards/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    $api_instance->boards/delete(boardId => $boardId, adAccountId => $adAccountId);
};
if ($@) {
    warn "Exception when calling BoardsApi->boards/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Delete board
    api_instance.boards/delete(boardId, adAccountId=adAccountId)
except ApiException as e:
    print("Exception when calling BoardsApi->boards/delete: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boards/delete(boardId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


boards/get

Get board

Get a board owned by the operation user_account - or a group board that has been shared with this account. - Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Board result = apiInstance.boards/get(boardId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boards/get(boardId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boards/get: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Board result = apiInstance.boards/get(boardId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get board
[apiInstance boards/getWith:boardId
    adAccountId:adAccountId
              completionHandler: ^(Board output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boards/get(boardId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boards/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get board
                Board result = apiInstance.boards/get(boardId, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boards/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->boards/get($boardId, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boards/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->boards/get(boardId => $boardId, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boards/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get board
    api_response = api_instance.boards/get(boardId, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boards/get: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boards/get(boardId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


boards/list

List boards

Get a list of the boards owned by the "operation user_account" + group boards where this account is a collaborator Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". Optional: Specify a privacy type (public, protected, or secret) to indicate which boards to return. - If no privacy is specified, all boards that can be returned (based on the scopes of the token and ad_account role if applicable) will be returned.


/boards

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards?ad_account_id=adAccountId_example&bookmark=bookmark_example&page_size=56&privacy=privacy_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String privacy = privacy_example; // String | Privacy setting for a board.

        try {
            boards_list_200_response result = apiInstance.boards/list(adAccountId, bookmark, pageSize, privacy);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String privacy = new String(); // String | Privacy setting for a board.

try {
    final result = await api_instance.boards/list(adAccountId, bookmark, pageSize, privacy);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boards/list: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String privacy = privacy_example; // String | Privacy setting for a board.

        try {
            boards_list_200_response result = apiInstance.boards/list(adAccountId, bookmark, pageSize, privacy);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *privacy = privacy_example; // Privacy setting for a board. (optional) (default to null)

// List boards
[apiInstance boards/listWith:adAccountId
    bookmark:bookmark
    pageSize:pageSize
    privacy:privacy
              completionHandler: ^(boards_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var opts = {
  'adAccountId': adAccountId_example, // {String} Unique identifier of an ad account.
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'privacy': privacy_example // {String} Privacy setting for a board.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boards/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boards/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var privacy = privacy_example;  // String | Privacy setting for a board. (optional)  (default to null)

            try {
                // List boards
                boards_list_200_response result = apiInstance.boards/list(adAccountId, bookmark, pageSize, privacy);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boards/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$privacy = privacy_example; // String | Privacy setting for a board.

try {
    $result = $api_instance->boards/list($adAccountId, $bookmark, $pageSize, $privacy);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boards/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $privacy = privacy_example; # String | Privacy setting for a board.

eval {
    my $result = $api_instance->boards/list(adAccountId => $adAccountId, bookmark => $bookmark, pageSize => $pageSize, privacy => $privacy);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boards/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
privacy = privacy_example # String | Privacy setting for a board. (optional) (default to null)

try:
    # List boards
    api_response = api_instance.boards/list(adAccountId=adAccountId, bookmark=bookmark, pageSize=pageSize, privacy=privacy)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boards/list: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let privacy = privacy_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boards/list(adAccountId, bookmark, pageSize, privacy, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join

Parameters

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
privacy
String
Privacy setting for a board.

Responses


boards/listPins

List Pins on board

Get a list of the Pins on a board owned by the "operation user_account" - or on a group board that has been shared with this account. - Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}/pins

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}/pins?bookmark=bookmark_example&page_size=56&creative_types=&ad_account_id=adAccountId_example&pin_metrics=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        array[String] creativeTypes = ; // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. String adAccountId = adAccountId_example; // String | Unique identifier of an ad account. Boolean pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { boards_list_pins_200_response result = apiInstance.boards/listPins(boardId, bookmark, pageSize, creativeTypes, adAccountId, pinMetrics); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BoardsApi#boards/listPins"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final array[String] creativeTypes = new array[String](); // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. final String adAccountId = new String(); // String | Unique identifier of an ad account. final Boolean pinMetrics = new Boolean(); // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { final result = await api_instance.boards/listPins(boardId, bookmark, pageSize, creativeTypes, adAccountId, pinMetrics); print(result); } catch (e) { print('Exception when calling DefaultApi->boards/listPins: $e\n'); }
import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        array[String] creativeTypes = ; // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. String adAccountId = adAccountId_example; // String | Unique identifier of an ad account. Boolean pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { boards_list_pins_200_response result = apiInstance.boards/listPins(boardId, bookmark, pageSize, creativeTypes, adAccountId, pinMetrics); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling BoardsApi#boards/listPins"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
array[String] *creativeTypes = ; // Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. (optional) (default to null) String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null) Boolean *pinMetrics = true; // Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false) // List Pins on board [apiInstance boards/listPinsWith:boardId bookmark:bookmark pageSize:pageSize creativeTypes:creativeTypes adAccountId:adAccountId pinMetrics:pinMetrics completionHandler: ^(boards_list_pins_200_response output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'creativeTypes': , // {array[String]} Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. 'adAccountId': adAccountId_example, // {String} Unique identifier of an ad account. 'pinMetrics': true // {Boolean} Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.boards/listPins(boardId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boards/listPinsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var creativeTypes = new array[String](); // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. (optional) (default to null) var adAccountId = adAccountId_example; // String | Unique identifier of an ad account. (optional) (default to null) var pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false) try { // List Pins on board boards_list_pins_200_response result = apiInstance.boards/listPins(boardId, bookmark, pageSize, creativeTypes, adAccountId, pinMetrics); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling BoardsApi.boards/listPins: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$creativeTypes = ; // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. $adAccountId = adAccountId_example; // String | Unique identifier of an ad account. $pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { $result = $api_instance->boards/listPins($boardId, $bookmark, $pageSize, $creativeTypes, $adAccountId, $pinMetrics); print_r($result); } catch (Exception $e) { echo 'Exception when calling BoardsApi->boards/listPins: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $creativeTypes = []; # array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account. my $pinMetrics = true; # Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. eval { my $result = $api_instance->boards/listPins(boardId => $boardId, bookmark => $bookmark, pageSize => $pageSize, creativeTypes => $creativeTypes, adAccountId => $adAccountId, pinMetrics => $pinMetrics); print Dumper($result); }; if ($@) { warn "Exception when calling BoardsApi->boards/listPins: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
creativeTypes =  # array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. (optional) (default to null) adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null) pinMetrics = true # Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false) try: # List Pins on board api_response = api_instance.boards/list_pins(boardId, bookmark=bookmark, pageSize=pageSize, creativeTypes=creativeTypes, adAccountId=adAccountId, pinMetrics=pinMetrics) pprint(api_response) except ApiException as e: print("Exception when calling BoardsApi->boards/listPins: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let creativeTypes = ; // array[String]
    let adAccountId = adAccountId_example; // String
    let pinMetrics = true; // Boolean

    let mut context = BoardsApi::Context::default();
    let result = client.boards/listPins(boardId, bookmark, pageSize, creativeTypes, adAccountId, pinMetrics, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
pins:read See your public Pins

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
creative_types
array[String]
Pin creative types filter. </p><strong>Note:</strong> SHOP_THE_PIN has been deprecated. Please use COLLECTION instead.
ad_account_id
String
Unique identifier of an ad account.
pin_metrics
Boolean
Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before <code>2023-03-20</code> lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.

Responses


boards/update

Update board

Update a board owned by the "operating user_account". - Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". - By default, the "operation user_account" is the token user_account.


/boards/{board_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/boards/{board_id}?ad_account_id=adAccountId_example" \
 -d '{
  "name" : "Summer Recipes",
  "description" : "My favorite summer recipes",
  "privacy" : "PUBLIC"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BoardsApi;

import java.io.File;
import java.util.*;

public class BoardsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        BoardUpdate boardUpdate = ; // BoardUpdate | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Board result = apiInstance.boards/update(boardId, boardUpdate, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String boardId = new String(); // String | Unique identifier of a board.
final BoardUpdate boardUpdate = new BoardUpdate(); // BoardUpdate | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boards/update(boardId, boardUpdate, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boards/update: $e\n');
}

import org.openapitools.client.api.BoardsApi;

public class BoardsApiExample {
    public static void main(String[] args) {
        BoardsApi apiInstance = new BoardsApi();
        String boardId = boardId_example; // String | Unique identifier of a board.
        BoardUpdate boardUpdate = ; // BoardUpdate | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Board result = apiInstance.boards/update(boardId, boardUpdate, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BoardsApi#boards/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BoardsApi *apiInstance = [[BoardsApi alloc] init];
String *boardId = boardId_example; // Unique identifier of a board. (default to null)
BoardUpdate *boardUpdate = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Update board
[apiInstance boards/updateWith:boardId
    boardUpdate:boardUpdate
    adAccountId:adAccountId
              completionHandler: ^(Board output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BoardsApi()
var boardId = boardId_example; // {String} Unique identifier of a board.
var boardUpdate = ; // {BoardUpdate} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boards/update(boardId, boardUpdate, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boards/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BoardsApi();
            var boardId = boardId_example;  // String | Unique identifier of a board. (default to null)
            var boardUpdate = new BoardUpdate(); // BoardUpdate | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Update board
                Board result = apiInstance.boards/update(boardId, boardUpdate, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BoardsApi.boards/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BoardsApi();
$boardId = boardId_example; // String | Unique identifier of a board.
$boardUpdate = ; // BoardUpdate | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->boards/update($boardId, $boardUpdate, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BoardsApi->boards/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BoardsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BoardsApi->new();
my $boardId = boardId_example; # String | Unique identifier of a board.
my $boardUpdate = WWW::OPenAPIClient::Object::BoardUpdate->new(); # BoardUpdate | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->boards/update(boardId => $boardId, boardUpdate => $boardUpdate, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BoardsApi->boards/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BoardsApi()
boardId = boardId_example # String | Unique identifier of a board. (default to null)
boardUpdate =  # BoardUpdate | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Update board
    api_response = api_instance.boards/update(boardId, boardUpdate, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BoardsApi->boards/update: %s\n" % e)
extern crate BoardsApi;

pub fn main() {
    let boardId = boardId_example; // String
    let boardUpdate = ; // BoardUpdate
    let adAccountId = adAccountId_example; // String

    let mut context = BoardsApi::Context::default();
    let result = client.boards/update(boardId, boardUpdate, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards

Parameters

Path parameters
Name Description
board_id*
String
Unique identifier of a board.
Required
Body parameters
Name Description
boardUpdate *

Update a board.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


Bulk

bulkDownload/create

Get advertiser entities in bulk

Create an asynchronous report that may include information on campaigns, ad groups, product groups, ads, and/or keywords; can filter by campaigns. Though the entities may be active, archived, or paused, only active entities will return data.


/ad_accounts/{ad_account_id}/bulk/download

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/bulk/download" \
 -d '{
  "output_format" : "JSON",
  "entity_types" : [ "CAMPAIGN", "AD_GROUP" ],
  "updated_since" : "1622848072",
  "campaign_filter" : {
    "start_time" : "1622848072",
    "campaign_status" : [ "RUNNING", "RUNNING" ],
    "end_time" : "1622848072",
    "name" : "campaign name",
    "objective_type" : [ null, null ]
  },
  "entity_ids" : [ "entity_ids", "entity_ids" ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BulkApi;

import java.io.File;
import java.util.*;

public class BulkApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BulkApi apiInstance = new BulkApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        BulkDownloadRequest bulkDownloadRequest = ; // BulkDownloadRequest | 

        try {
            BulkDownloadResponse result = apiInstance.bulkDownload/create(adAccountId, bulkDownloadRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BulkApi#bulkDownload/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final BulkDownloadRequest bulkDownloadRequest = new BulkDownloadRequest(); // BulkDownloadRequest | 

try {
    final result = await api_instance.bulkDownload/create(adAccountId, bulkDownloadRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->bulkDownload/create: $e\n');
}

import org.openapitools.client.api.BulkApi;

public class BulkApiExample {
    public static void main(String[] args) {
        BulkApi apiInstance = new BulkApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        BulkDownloadRequest bulkDownloadRequest = ; // BulkDownloadRequest | 

        try {
            BulkDownloadResponse result = apiInstance.bulkDownload/create(adAccountId, bulkDownloadRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BulkApi#bulkDownload/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BulkApi *apiInstance = [[BulkApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
BulkDownloadRequest *bulkDownloadRequest = ; // 

// Get advertiser entities in bulk
[apiInstance bulkDownload/createWith:adAccountId
    bulkDownloadRequest:bulkDownloadRequest
              completionHandler: ^(BulkDownloadResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BulkApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var bulkDownloadRequest = ; // {BulkDownloadRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkDownload/create(adAccountId, bulkDownloadRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class bulkDownload/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BulkApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bulkDownloadRequest = new BulkDownloadRequest(); // BulkDownloadRequest | 

            try {
                // Get advertiser entities in bulk
                BulkDownloadResponse result = apiInstance.bulkDownload/create(adAccountId, bulkDownloadRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BulkApi.bulkDownload/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BulkApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bulkDownloadRequest = ; // BulkDownloadRequest | 

try {
    $result = $api_instance->bulkDownload/create($adAccountId, $bulkDownloadRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BulkApi->bulkDownload/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BulkApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BulkApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bulkDownloadRequest = WWW::OPenAPIClient::Object::BulkDownloadRequest->new(); # BulkDownloadRequest | 

eval {
    my $result = $api_instance->bulkDownload/create(adAccountId => $adAccountId, bulkDownloadRequest => $bulkDownloadRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BulkApi->bulkDownload/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BulkApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bulkDownloadRequest =  # BulkDownloadRequest | 

try:
    # Get advertiser entities in bulk
    api_response = api_instance.bulk_download/create(adAccountId, bulkDownloadRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BulkApi->bulkDownload/create: %s\n" % e)
extern crate BulkApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bulkDownloadRequest = ; // BulkDownloadRequest

    let mut context = BulkApi::Context::default();
    let result = client.bulkDownload/create(adAccountId, bulkDownloadRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
bulkDownloadRequest *

Parameters to get ad entities in bulk

Responses


bulkRequest/get

Download advertiser entities in bulk

Get the status of a bulk request by <code>request_id</code>, along with a download URL that will allow you to download the new or updated entity data (campaigns, ad groups, product groups, ads, or keywords).


/ad_accounts/{ad_account_id}/bulk/{bulk_request_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/bulk/{bulk_request_id}?include_details=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BulkApi;

import java.io.File;
import java.util.*;

public class BulkApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BulkApi apiInstance = new BulkApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bulkRequestId = bulkRequestId_example; // String | Unique identifier of a bulk upsert request.
        Boolean includeDetails = true; // Boolean | if set to True then attach the errors/details to all the requests

        try {
            BulkUpsertStatusResponse result = apiInstance.bulkRequest/get(adAccountId, bulkRequestId, includeDetails);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BulkApi#bulkRequest/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String bulkRequestId = new String(); // String | Unique identifier of a bulk upsert request.
final Boolean includeDetails = new Boolean(); // Boolean | if set to True then attach the errors/details to all the requests

try {
    final result = await api_instance.bulkRequest/get(adAccountId, bulkRequestId, includeDetails);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->bulkRequest/get: $e\n');
}

import org.openapitools.client.api.BulkApi;

public class BulkApiExample {
    public static void main(String[] args) {
        BulkApi apiInstance = new BulkApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String bulkRequestId = bulkRequestId_example; // String | Unique identifier of a bulk upsert request.
        Boolean includeDetails = true; // Boolean | if set to True then attach the errors/details to all the requests

        try {
            BulkUpsertStatusResponse result = apiInstance.bulkRequest/get(adAccountId, bulkRequestId, includeDetails);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BulkApi#bulkRequest/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BulkApi *apiInstance = [[BulkApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *bulkRequestId = bulkRequestId_example; // Unique identifier of a bulk upsert request. (default to null)
Boolean *includeDetails = true; // if set to True then attach the errors/details to all the requests (optional) (default to false)

// Download advertiser entities in bulk
[apiInstance bulkRequest/getWith:adAccountId
    bulkRequestId:bulkRequestId
    includeDetails:includeDetails
              completionHandler: ^(BulkUpsertStatusResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BulkApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var bulkRequestId = bulkRequestId_example; // {String} Unique identifier of a bulk upsert request.
var opts = {
  'includeDetails': true // {Boolean} if set to True then attach the errors/details to all the requests
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkRequest/get(adAccountId, bulkRequestId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class bulkRequest/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BulkApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bulkRequestId = bulkRequestId_example;  // String | Unique identifier of a bulk upsert request. (default to null)
            var includeDetails = true;  // Boolean | if set to True then attach the errors/details to all the requests (optional)  (default to false)

            try {
                // Download advertiser entities in bulk
                BulkUpsertStatusResponse result = apiInstance.bulkRequest/get(adAccountId, bulkRequestId, includeDetails);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BulkApi.bulkRequest/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BulkApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bulkRequestId = bulkRequestId_example; // String | Unique identifier of a bulk upsert request.
$includeDetails = true; // Boolean | if set to True then attach the errors/details to all the requests

try {
    $result = $api_instance->bulkRequest/get($adAccountId, $bulkRequestId, $includeDetails);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BulkApi->bulkRequest/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BulkApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BulkApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bulkRequestId = bulkRequestId_example; # String | Unique identifier of a bulk upsert request.
my $includeDetails = true; # Boolean | if set to True then attach the errors/details to all the requests

eval {
    my $result = $api_instance->bulkRequest/get(adAccountId => $adAccountId, bulkRequestId => $bulkRequestId, includeDetails => $includeDetails);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BulkApi->bulkRequest/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BulkApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bulkRequestId = bulkRequestId_example # String | Unique identifier of a bulk upsert request. (default to null)
includeDetails = true # Boolean | if set to True then attach the errors/details to all the requests (optional) (default to false)

try:
    # Download advertiser entities in bulk
    api_response = api_instance.bulk_request/get(adAccountId, bulkRequestId, includeDetails=includeDetails)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BulkApi->bulkRequest/get: %s\n" % e)
extern crate BulkApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bulkRequestId = bulkRequestId_example; // String
    let includeDetails = true; // Boolean

    let mut context = BulkApi::Context::default();
    let result = client.bulkRequest/get(adAccountId, bulkRequestId, includeDetails, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
bulk_request_id*
String
Unique identifier of a bulk upsert request.
Required
Query parameters
Name Description
include_details
Boolean
if set to True then attach the errors/details to all the requests

Responses


bulkUpsert/create

Create/update ad entities in bulk

Either create or update any combination of campaigns, ad groups, product groups, ads, or keywords. Note that this request will be processed asynchronously; the response will include a <code>request_id</code> that can be used to obtain the status of the request.


/ad_accounts/{ad_account_id}/bulk/upsert

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/bulk/upsert" \
 -d '{
  "create" : {
    "ad_groups" : [ {
      "bid_in_micro_currency" : 5000000,
      "end_time" : 5705424000,
      "auto_targeting_enabled" : true,
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "budget_in_micro_currency" : 5000000,
      "bid_strategy_type" : "MAX_BID",
      "start_time" : 5686848000,
      "billable_event" : "CLICKTHROUGH",
      "targeting_spec" : {
        "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
        "GEO" : [ "GEO", "GEO" ],
        "LOCATION" : [ "LOCATION", "LOCATION" ],
        "LOCALE" : [ "LOCALE", "LOCALE" ],
        "AGE_BUCKET" : [ "35-44", "50-54" ],
        "SHOPPING_RETARGETING" : [ {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        }, {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        } ],
        "GENDER" : [ "unknown", "unknown" ],
        "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
        "APPTYPE" : [ "ipad", "iphone" ],
        "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
        "INTEREST" : [ "INTEREST", "INTEREST" ]
      },
      "name" : "Ad Group For Pin: 687195905986",
      "lifetime_frequency_cap" : 100,
      "optimization_goal_metadata" : {
        "frequency_goal_metadata" : {
          "timerange" : "DAY",
          "frequency" : 5
        },
        "conversion_tag_v3_goal_metadata" : {
          "attribution_windows" : {
            "view_window_days" : 1,
            "click_window_days" : 0,
            "engagement_window_days" : 6
          },
          "conversion_tag_id" : "conversion_tag_id",
          "learning_mode_type" : "ACTIVE",
          "conversion_event" : "PAGE_VISIT",
          "is_roas_optimized" : true,
          "cpa_goal_value_in_micro_currency" : "cpa_goal_value_in_micro_currency"
        },
        "scrollup_goal_metadata" : {
          "scrollup_goal_value_in_micro_currency" : "scrollup_goal_value_in_micro_currency"
        }
      },
      "placement_group" : "placement_group",
      "budget_type" : "DAILY",
      "campaign_id" : "626736533506",
      "status" : "status",
      "pacing_delivery_type" : "STANDARD"
    }, {
      "bid_in_micro_currency" : 5000000,
      "end_time" : 5705424000,
      "auto_targeting_enabled" : true,
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "budget_in_micro_currency" : 5000000,
      "bid_strategy_type" : "MAX_BID",
      "start_time" : 5686848000,
      "billable_event" : "CLICKTHROUGH",
      "targeting_spec" : {
        "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
        "GEO" : [ "GEO", "GEO" ],
        "LOCATION" : [ "LOCATION", "LOCATION" ],
        "LOCALE" : [ "LOCALE", "LOCALE" ],
        "AGE_BUCKET" : [ "35-44", "50-54" ],
        "SHOPPING_RETARGETING" : [ {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        }, {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        } ],
        "GENDER" : [ "unknown", "unknown" ],
        "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
        "APPTYPE" : [ "ipad", "iphone" ],
        "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
        "INTEREST" : [ "INTEREST", "INTEREST" ]
      },
      "name" : "Ad Group For Pin: 687195905986",
      "lifetime_frequency_cap" : 100,
      "optimization_goal_metadata" : {
        "frequency_goal_metadata" : {
          "timerange" : "DAY",
          "frequency" : 5
        },
        "conversion_tag_v3_goal_metadata" : {
          "attribution_windows" : {
            "view_window_days" : 1,
            "click_window_days" : 0,
            "engagement_window_days" : 6
          },
          "conversion_tag_id" : "conversion_tag_id",
          "learning_mode_type" : "ACTIVE",
          "conversion_event" : "PAGE_VISIT",
          "is_roas_optimized" : true,
          "cpa_goal_value_in_micro_currency" : "cpa_goal_value_in_micro_currency"
        },
        "scrollup_goal_metadata" : {
          "scrollup_goal_value_in_micro_currency" : "scrollup_goal_value_in_micro_currency"
        }
      },
      "placement_group" : "placement_group",
      "budget_type" : "DAILY",
      "campaign_id" : "626736533506",
      "status" : "status",
      "pacing_delivery_type" : "STANDARD"
    } ],
    "ads" : [ {
      "is_removable" : false,
      "view_tracking_url" : "view_tracking_url",
      "android_deep_link" : "android_deep_link",
      "destination_url" : "destination_url",
      "carousel_android_deep_links" : [ "carousel_android_deep_links", "carousel_android_deep_links" ],
      "carousel_destination_urls" : [ "carousel_destination_urls", "carousel_destination_urls" ],
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "ios_deep_link" : "ios_deep_link",
      "carousel_ios_deep_links" : [ "carousel_ios_deep_links", "carousel_ios_deep_links" ],
      "click_tracking_url" : "click_tracking_url",
      "is_pin_deleted" : false,
      "creative_type" : "REGULAR",
      "grid_click_type" : "CLOSEUP",
      "quiz_pin_data" : {
        "questions" : [ {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        }, {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        } ],
        "results" : [ {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        }, {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        } ]
      },
      "name" : "name",
      "lead_form_id" : "lead_form_id",
      "customizable_cta_type" : "LEARN_MORE",
      "ad_group_id" : "2680059592705",
      "pin_id" : "394205773611545468",
      "status" : "ACTIVE"
    }, {
      "is_removable" : false,
      "view_tracking_url" : "view_tracking_url",
      "android_deep_link" : "android_deep_link",
      "destination_url" : "destination_url",
      "carousel_android_deep_links" : [ "carousel_android_deep_links", "carousel_android_deep_links" ],
      "carousel_destination_urls" : [ "carousel_destination_urls", "carousel_destination_urls" ],
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "ios_deep_link" : "ios_deep_link",
      "carousel_ios_deep_links" : [ "carousel_ios_deep_links", "carousel_ios_deep_links" ],
      "click_tracking_url" : "click_tracking_url",
      "is_pin_deleted" : false,
      "creative_type" : "REGULAR",
      "grid_click_type" : "CLOSEUP",
      "quiz_pin_data" : {
        "questions" : [ {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        }, {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        } ],
        "results" : [ {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        }, {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        } ]
      },
      "name" : "name",
      "lead_form_id" : "lead_form_id",
      "customizable_cta_type" : "LEARN_MORE",
      "ad_group_id" : "2680059592705",
      "pin_id" : "394205773611545468",
      "status" : "ACTIVE"
    } ],
    "campaigns" : [ { }, { } ],
    "keywords" : [ {
      "keywords" : [ {
        "match_type" : "BROAD",
        "bid" : 200000,
        "value" : "value"
      }, {
        "match_type" : "BROAD",
        "bid" : 200000,
        "value" : "value"
      } ],
      "parent_id" : "383791336903426391"
    }, {
      "keywords" : [ {
        "match_type" : "BROAD",
        "bid" : 200000,
        "value" : "value"
      }, {
        "match_type" : "BROAD",
        "bid" : 200000,
        "value" : "value"
      } ],
      "parent_id" : "383791336903426391"
    } ],
    "product_groups" : [ {
      "product_group_promotion" : [ {
        "slideshow_collections_description" : "Description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123123",
        "catalog_product_group_name" : "catalogProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "is_mdl" : true,
        "status" : "ACTIVE"
      }, {
        "slideshow_collections_description" : "Description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123123",
        "catalog_product_group_name" : "catalogProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "is_mdl" : true,
        "status" : "ACTIVE"
      } ],
      "ad_group_id" : "2680059592705"
    }, {
      "product_group_promotion" : [ {
        "slideshow_collections_description" : "Description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123123",
        "catalog_product_group_name" : "catalogProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "is_mdl" : true,
        "status" : "ACTIVE"
      }, {
        "slideshow_collections_description" : "Description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123123",
        "catalog_product_group_name" : "catalogProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "is_mdl" : true,
        "status" : "ACTIVE"
      } ],
      "ad_group_id" : "2680059592705"
    } ]
  },
  "update" : {
    "ad_groups" : [ {
      "bid_in_micro_currency" : 5000000,
      "end_time" : 5705424000,
      "auto_targeting_enabled" : true,
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "budget_in_micro_currency" : 5000000,
      "bid_strategy_type" : "MAX_BID",
      "start_time" : 5686848000,
      "billable_event" : "CLICKTHROUGH",
      "targeting_spec" : {
        "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
        "GEO" : [ "GEO", "GEO" ],
        "LOCATION" : [ "LOCATION", "LOCATION" ],
        "LOCALE" : [ "LOCALE", "LOCALE" ],
        "AGE_BUCKET" : [ "35-44", "50-54" ],
        "SHOPPING_RETARGETING" : [ {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        }, {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        } ],
        "GENDER" : [ "unknown", "unknown" ],
        "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
        "APPTYPE" : [ "ipad", "iphone" ],
        "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
        "INTEREST" : [ "INTEREST", "INTEREST" ]
      },
      "name" : "Ad Group For Pin: 687195905986",
      "lifetime_frequency_cap" : 100,
      "id" : "2680060704746",
      "optimization_goal_metadata" : {
        "frequency_goal_metadata" : {
          "timerange" : "DAY",
          "frequency" : 5
        },
        "conversion_tag_v3_goal_metadata" : {
          "attribution_windows" : {
            "view_window_days" : 1,
            "click_window_days" : 0,
            "engagement_window_days" : 6
          },
          "conversion_tag_id" : "conversion_tag_id",
          "learning_mode_type" : "ACTIVE",
          "conversion_event" : "PAGE_VISIT",
          "is_roas_optimized" : true,
          "cpa_goal_value_in_micro_currency" : "cpa_goal_value_in_micro_currency"
        },
        "scrollup_goal_metadata" : {
          "scrollup_goal_value_in_micro_currency" : "scrollup_goal_value_in_micro_currency"
        }
      },
      "placement_group" : "placement_group",
      "budget_type" : "budget_type",
      "campaign_id" : "626736533506",
      "status" : "status",
      "pacing_delivery_type" : "pacing_delivery_type"
    }, {
      "bid_in_micro_currency" : 5000000,
      "end_time" : 5705424000,
      "auto_targeting_enabled" : true,
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "budget_in_micro_currency" : 5000000,
      "bid_strategy_type" : "MAX_BID",
      "start_time" : 5686848000,
      "billable_event" : "CLICKTHROUGH",
      "targeting_spec" : {
        "AUDIENCE_INCLUDE'" : [ "AUDIENCE_INCLUDE'", "AUDIENCE_INCLUDE'" ],
        "GEO" : [ "GEO", "GEO" ],
        "LOCATION" : [ "LOCATION", "LOCATION" ],
        "LOCALE" : [ "LOCALE", "LOCALE" ],
        "AGE_BUCKET" : [ "35-44", "50-54" ],
        "SHOPPING_RETARGETING" : [ {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        }, {
          "lookback_window" : 30,
          "exclusion_window" : 14,
          "tag_types" : [ 0, 6 ]
        } ],
        "GENDER" : [ "unknown", "unknown" ],
        "TARGETING_STRATEGY" : [ "CHOOSE_YOUR_OWN", "CHOOSE_YOUR_OWN" ],
        "APPTYPE" : [ "ipad", "iphone" ],
        "AUDIENCE_EXCLUDE" : [ "AUDIENCE_EXCLUDE", "AUDIENCE_EXCLUDE" ],
        "INTEREST" : [ "INTEREST", "INTEREST" ]
      },
      "name" : "Ad Group For Pin: 687195905986",
      "lifetime_frequency_cap" : 100,
      "id" : "2680060704746",
      "optimization_goal_metadata" : {
        "frequency_goal_metadata" : {
          "timerange" : "DAY",
          "frequency" : 5
        },
        "conversion_tag_v3_goal_metadata" : {
          "attribution_windows" : {
            "view_window_days" : 1,
            "click_window_days" : 0,
            "engagement_window_days" : 6
          },
          "conversion_tag_id" : "conversion_tag_id",
          "learning_mode_type" : "ACTIVE",
          "conversion_event" : "PAGE_VISIT",
          "is_roas_optimized" : true,
          "cpa_goal_value_in_micro_currency" : "cpa_goal_value_in_micro_currency"
        },
        "scrollup_goal_metadata" : {
          "scrollup_goal_value_in_micro_currency" : "scrollup_goal_value_in_micro_currency"
        }
      },
      "placement_group" : "placement_group",
      "budget_type" : "budget_type",
      "campaign_id" : "626736533506",
      "status" : "status",
      "pacing_delivery_type" : "pacing_delivery_type"
    } ],
    "ads" : [ {
      "is_removable" : false,
      "view_tracking_url" : "view_tracking_url",
      "android_deep_link" : "android_deep_link",
      "destination_url" : "destination_url",
      "carousel_android_deep_links" : [ "carousel_android_deep_links", "carousel_android_deep_links" ],
      "carousel_destination_urls" : [ "carousel_destination_urls", "carousel_destination_urls" ],
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "ios_deep_link" : "ios_deep_link",
      "carousel_ios_deep_links" : [ "carousel_ios_deep_links", "carousel_ios_deep_links" ],
      "click_tracking_url" : "click_tracking_url",
      "is_pin_deleted" : false,
      "creative_type" : "REGULAR",
      "grid_click_type" : "CLOSEUP",
      "quiz_pin_data" : {
        "questions" : [ {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        }, {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        } ],
        "results" : [ {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        }, {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        } ]
      },
      "name" : "name",
      "lead_form_id" : "lead_form_id",
      "customizable_cta_type" : "LEARN_MORE",
      "id" : "687195134316",
      "ad_group_id" : "2680059592705",
      "pin_id" : "394205773611545468",
      "status" : "ACTIVE"
    }, {
      "is_removable" : false,
      "view_tracking_url" : "view_tracking_url",
      "android_deep_link" : "android_deep_link",
      "destination_url" : "destination_url",
      "carousel_android_deep_links" : [ "carousel_android_deep_links", "carousel_android_deep_links" ],
      "carousel_destination_urls" : [ "carousel_destination_urls", "carousel_destination_urls" ],
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "ios_deep_link" : "ios_deep_link",
      "carousel_ios_deep_links" : [ "carousel_ios_deep_links", "carousel_ios_deep_links" ],
      "click_tracking_url" : "click_tracking_url",
      "is_pin_deleted" : false,
      "creative_type" : "REGULAR",
      "grid_click_type" : "CLOSEUP",
      "quiz_pin_data" : {
        "questions" : [ {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        }, {
          "question_id" : 1,
          "question_text" : "Where do you thrive?",
          "options" : [ {
            "text" : "Hangout vibes"
          }, {
            "text" : "Time to party!"
          }, {
            "text" : "Keeping it lowkey"
          } ]
        } ],
        "results" : [ {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        }, {
          "organic_pin_id" : "pinId",
          "android_deep_link" : "https://www.pinterest.com/",
          "ios_deep_link" : "https://www.pinterest.com/",
          "destination_url" : "https://www.pinterest.com/"
        } ]
      },
      "name" : "name",
      "lead_form_id" : "lead_form_id",
      "customizable_cta_type" : "LEARN_MORE",
      "id" : "687195134316",
      "ad_group_id" : "2680059592705",
      "pin_id" : "394205773611545468",
      "status" : "ACTIVE"
    } ],
    "campaigns" : [ {
      "lifetime_spend_cap" : 1432744744,
      "end_time" : 1644023526,
      "is_flexible_daily_budgets" : true,
      "daily_spend_cap" : 1432744744,
      "objective_type" : "objective_type",
      "summary_status" : "summary_status",
      "is_campaign_budget_optimization" : true,
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "ad_account_id" : "549755885175",
      "is_automated_campaign" : true,
      "start_time" : 1580865126,
      "name" : "ACME Tools",
      "order_line_id" : "549755885175",
      "id" : "549755885175",
      "status" : "status"
    }, {
      "lifetime_spend_cap" : 1432744744,
      "end_time" : 1644023526,
      "is_flexible_daily_budgets" : true,
      "daily_spend_cap" : 1432744744,
      "objective_type" : "objective_type",
      "summary_status" : "summary_status",
      "is_campaign_budget_optimization" : true,
      "tracking_urls" : {
        "engagement" : [ "engagement", "engagement" ],
        "audience_verification" : [ "audience_verification", "audience_verification" ],
        "impression" : [ "impression", "impression" ],
        "buyable_button" : [ "buyable_button", "buyable_button" ],
        "click" : [ "click", "click" ]
      },
      "ad_account_id" : "549755885175",
      "is_automated_campaign" : true,
      "start_time" : 1580865126,
      "name" : "ACME Tools",
      "order_line_id" : "549755885175",
      "id" : "549755885175",
      "status" : "status"
    } ],
    "keywords" : [ {
      "archived" : false,
      "id" : "2886364308355",
      "bid" : 200000
    }, {
      "archived" : false,
      "id" : "2886364308355",
      "bid" : 200000
    } ],
    "product_groups" : [ {
      "product_group_promotion" : [ {
        "catalog_product_group_id" : "1234123",
        "slideshow_collections_description" : "Description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123123",
        "catalog_product_group_name" : "ProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "status" : "ACTIVE",
        "id" : "2680059592705"
      }, {
        "catalog_product_group_id" : "1231231",
        "slideshow_collections_description" : "Other description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123124",
        "catalog_product_group_name" : "ProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "status" : "ACTIVE",
        "id" : "2680059592706"
      } ],
      "ad_group_id" : "26823439592705"
    }, {
      "product_group_promotion" : [ {
        "catalog_product_group_id" : "1234123",
        "slideshow_collections_description" : "Description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123123",
        "catalog_product_group_name" : "ProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "status" : "ACTIVE",
        "id" : "2680059592705"
      }, {
        "catalog_product_group_id" : "1231231",
        "slideshow_collections_description" : "Other description",
        "creative_type" : "REGULAR",
        "collections_hero_pin_id" : "123124",
        "catalog_product_group_name" : "ProductGroupName",
        "collections_hero_destination_url" : "http://www.pinterest.com",
        "tracking_url" : "https://www.pinterest.com",
        "slideshow_collections_title" : "Title",
        "status" : "ACTIVE",
        "id" : "2680059592706"
      } ],
      "ad_group_id" : "26823439592705"
    } ]
  }
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.BulkApi;

import java.io.File;
import java.util.*;

public class BulkApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        BulkApi apiInstance = new BulkApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        BulkUpsertRequest bulkUpsertRequest = ; // BulkUpsertRequest | 

        try {
            BulkUpsertResponse result = apiInstance.bulkUpsert/create(adAccountId, bulkUpsertRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BulkApi#bulkUpsert/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final BulkUpsertRequest bulkUpsertRequest = new BulkUpsertRequest(); // BulkUpsertRequest | 

try {
    final result = await api_instance.bulkUpsert/create(adAccountId, bulkUpsertRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->bulkUpsert/create: $e\n');
}

import org.openapitools.client.api.BulkApi;

public class BulkApiExample {
    public static void main(String[] args) {
        BulkApi apiInstance = new BulkApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        BulkUpsertRequest bulkUpsertRequest = ; // BulkUpsertRequest | 

        try {
            BulkUpsertResponse result = apiInstance.bulkUpsert/create(adAccountId, bulkUpsertRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BulkApi#bulkUpsert/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
BulkApi *apiInstance = [[BulkApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
BulkUpsertRequest *bulkUpsertRequest = ; // 

// Create/update ad entities in bulk
[apiInstance bulkUpsert/createWith:adAccountId
    bulkUpsertRequest:bulkUpsertRequest
              completionHandler: ^(BulkUpsertResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.BulkApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var bulkUpsertRequest = ; // {BulkUpsertRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bulkUpsert/create(adAccountId, bulkUpsertRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class bulkUpsert/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new BulkApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var bulkUpsertRequest = new BulkUpsertRequest(); // BulkUpsertRequest | 

            try {
                // Create/update ad entities in bulk
                BulkUpsertResponse result = apiInstance.bulkUpsert/create(adAccountId, bulkUpsertRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling BulkApi.bulkUpsert/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\BulkApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$bulkUpsertRequest = ; // BulkUpsertRequest | 

try {
    $result = $api_instance->bulkUpsert/create($adAccountId, $bulkUpsertRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BulkApi->bulkUpsert/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::BulkApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::BulkApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $bulkUpsertRequest = WWW::OPenAPIClient::Object::BulkUpsertRequest->new(); # BulkUpsertRequest | 

eval {
    my $result = $api_instance->bulkUpsert/create(adAccountId => $adAccountId, bulkUpsertRequest => $bulkUpsertRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling BulkApi->bulkUpsert/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.BulkApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
bulkUpsertRequest =  # BulkUpsertRequest | 

try:
    # Create/update ad entities in bulk
    api_response = api_instance.bulk_upsert/create(adAccountId, bulkUpsertRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BulkApi->bulkUpsert/create: %s\n" % e)
extern crate BulkApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let bulkUpsertRequest = ; // BulkUpsertRequest

    let mut context = BulkApi::Context::default();
    let result = client.bulkUpsert/create(adAccountId, bulkUpsertRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
bulkUpsertRequest *

Parameters to get create/update ad entities in bulk

Responses


Campaigns

campaignTargetingAnalytics/get

Get targeting analytics for campaigns

Get targeting analytics for one or more campaigns. For the requested account and metrics, the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. "age_bucket") for applicable values (e.g. "45-49"). <p/> - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/campaigns/targeting_analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns/targeting_analytics?campaign_ids=&start_date=2013-10-20&end_date=2013-10-20&targeting_types=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION&attribution_types="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;

import java.io.File;
import java.util.*;

public class CampaignsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.campaignTargetingAnalytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CampaignsApi#campaignTargetingAnalytics/get"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[AdsAnalyticsTargetingType] targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. final ConversionReportAttributionType attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report try { final result = await api_instance.campaignTargetingAnalytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); print(result); } catch (e) { print('Exception when calling DefaultApi->campaignTargetingAnalytics/get: $e\n'); }
import org.openapitools.client.api.CampaignsApi;

public class CampaignsApiExample {
    public static void main(String[] args) {
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[AdsAnalyticsTargetingType] targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. ConversionReportAttributionType attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { MetricsResponse result = apiInstance.campaignTargetingAnalytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CampaignsApi#campaignTargetingAnalytics/get"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *campaignIds = ; // List of Campaign Ids to use to filter the results. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[AdsAnalyticsTargetingType] *targetingTypes = ; // Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) ConversionReportAttributionType *attributionTypes = ; // List of types of attribution for the conversion report (optional) (default to null) // Get targeting analytics for campaigns [apiInstance campaignTargetingAnalytics/getWith:adAccountId campaignIds:campaignIds startDate:startDate endDate:endDate targetingTypes:targetingTypes columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime attributionTypes:attributionTypes completionHandler: ^(MetricsResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CampaignsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var campaignIds = ; // {array[String]} List of Campaign Ids to use to filter the results.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var targetingTypes = ; // {array[AdsAnalyticsTargetingType]} Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION, // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. 'attributionTypes': // {ConversionReportAttributionType} List of types of attribution for the conversion report }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.campaignTargetingAnalytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class campaignTargetingAnalytics/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CampaignsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var targetingTypes = new array[AdsAnalyticsTargetingType](); // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) var attributionTypes = new ConversionReportAttributionType(); // ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try { // Get targeting analytics for campaigns MetricsResponse result = apiInstance.campaignTargetingAnalytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling CampaignsApi.campaignTargetingAnalytics/get: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$targetingTypes = ; // array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. $columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. $attributionTypes = ; // ConversionReportAttributionType | List of types of attribution for the conversion report try { $result = $api_instance->campaignTargetingAnalytics/get($adAccountId, $campaignIds, $startDate, $endDate, $targetingTypes, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime, $attributionTypes); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignsApi->campaignTargetingAnalytics/get: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignIds = []; # array[String] | List of Campaign Ids to use to filter the results.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $targetingTypes = []; # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. my $attributionTypes = ; # ConversionReportAttributionType | List of types of attribution for the conversion report eval { my $result = $api_instance->campaignTargetingAnalytics/get(adAccountId => $adAccountId, campaignIds => $campaignIds, startDate => $startDate, endDate => $endDate, targetingTypes => $targetingTypes, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime, attributionTypes => $attributionTypes); print Dumper($result); }; if ($@) { warn "Exception when calling CampaignsApi->campaignTargetingAnalytics/get: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignIds =  # array[String] | List of Campaign Ids to use to filter the results. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
targetingTypes =  # array[AdsAnalyticsTargetingType] | Targeting type breakdowns for the report. The reporting per targeting type 
is independent from each other. (default to null) columns = # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) attributionTypes = # ConversionReportAttributionType | List of types of attribution for the conversion report (optional) (default to null) try: # Get targeting analytics for campaigns api_response = api_instance.campaign_targeting_analytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime, attributionTypes=attributionTypes) pprint(api_response) except ApiException as e: print("Exception when calling CampaignsApi->campaignTargetingAnalytics/get: %s\n" % e)
extern crate CampaignsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignIds = ; // array[String]
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let targetingTypes = ; // array[AdsAnalyticsTargetingType]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String
    let attributionTypes = ; // ConversionReportAttributionType

    let mut context = CampaignsApi::Context::default();
    let result = client.campaignTargetingAnalytics/get(adAccountId, campaignIds, startDate, endDate, targetingTypes, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, attributionTypes, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
campaign_ids*
array[String]
List of Campaign Ids to use to filter the results.
Required
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
targeting_types*
array[AdsAnalyticsTargetingType]
Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
attribution_types
ConversionReportAttributionType
List of types of attribution for the conversion report

Responses


campaigns/analytics

Get campaign analytics

Get analytics for the specified campaigns in the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/campaigns/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns/analytics?start_date=2013-10-20&end_date=2013-10-20&campaign_ids=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;

import java.io.File;
import java.util.*;

public class CampaignsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[CampaignsAnalyticsResponse_inner] result = apiInstance.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CampaignsApi#campaigns/analytics"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[String] campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results.
final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { final result = await api_instance.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); print(result); } catch (e) { print('Exception when calling DefaultApi->campaigns/analytics: $e\n'); }
import org.openapitools.client.api.CampaignsApi;

public class CampaignsApiExample {
    public static void main(String[] args) {
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[CampaignsAnalyticsResponse_inner] result = apiInstance.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CampaignsApi#campaigns/analytics"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[String] *campaignIds = ; // List of Campaign Ids to use to filter the results. (default to null)
array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) // Get campaign analytics [apiInstance campaigns/analyticsWith:adAccountId startDate:startDate endDate:endDate campaignIds:campaignIds columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime completionHandler: ^(array[CampaignsAnalyticsResponse_inner] output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CampaignsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var campaignIds = ; // {array[String]} List of Campaign Ids to use to filter the results.
var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class campaigns/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CampaignsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results. (default to null)
            var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try { // Get campaign analytics array[CampaignsAnalyticsResponse_inner] result = apiInstance.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling CampaignsApi.campaigns/analytics: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
$columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { $result = $api_instance->campaigns/analytics($adAccountId, $startDate, $endDate, $campaignIds, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime); print_r($result); } catch (Exception $e) { echo 'Exception when calling CampaignsApi->campaigns/analytics: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $campaignIds = []; # array[String] | List of Campaign Ids to use to filter the results.
my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. eval { my $result = $api_instance->campaigns/analytics(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, campaignIds => $campaignIds, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime); print Dumper($result); }; if ($@) { warn "Exception when calling CampaignsApi->campaigns/analytics: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
campaignIds =  # array[String] | List of Campaign Ids to use to filter the results. (default to null)
columns =  # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try: # Get campaign analytics api_response = api_instance.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime) pprint(api_response) except ApiException as e: print("Exception when calling CampaignsApi->campaigns/analytics: %s\n" % e)
extern crate CampaignsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let campaignIds = ; // array[String]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String

    let mut context = CampaignsApi::Context::default();
    let result = client.campaigns/analytics(adAccountId, startDate, endDate, campaignIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
campaign_ids*
array[String]
List of Campaign Ids to use to filter the results.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.

Responses


campaigns/create

Create campaigns

Create multiple new campaigns. Every campaign has its own campaign_id and houses one or more ad groups, which contain one or more ads. For more, see <a href="https://help.pinterest.com/en/business/article/set-up-your-campaign/">Set up your campaign</a>. <p/> <strong>Note:</strong> - The values for 'lifetime_spend_cap' and 'daily_spend_cap' are microcurrency amounts based on the currency field set in the advertiser's profile. (e.g. USD) <p/> <p>Microcurrency is used to track very small transactions, based on the currency set in the advertiser’s profile.</p> <p>A microcurrency unit is 10^(-6) of the standard unit of currency selected in the advertiser’s profile.</p> <p><strong>Equivalency equations</strong>, using dollars as an example currency:</p> <ul> <li>$1 = 1,000,000 microdollars</li> <li>1 microdollar = $0.000001 </li> </ul> <p><strong>To convert between currency and microcurrency</strong>, using dollars as an example currency:</p> <ul> <li>To convert dollars to microdollars, mutiply dollars by 1,000,000</li> <li>To convert microdollars to dollars, divide microdollars by 1,000,000</li> </ul>


/ad_accounts/{ad_account_id}/campaigns

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns" \
 -d '{ }'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;

import java.io.File;
import java.util.*;

public class CampaignsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[CampaignCreateRequest] campaignCreateRequest = ; // array[CampaignCreateRequest] | 

        try {
            CampaignCreateResponse result = apiInstance.campaigns/create(adAccountId, campaignCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[CampaignCreateRequest] campaignCreateRequest = new array[CampaignCreateRequest](); // array[CampaignCreateRequest] | 

try {
    final result = await api_instance.campaigns/create(adAccountId, campaignCreateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->campaigns/create: $e\n');
}

import org.openapitools.client.api.CampaignsApi;

public class CampaignsApiExample {
    public static void main(String[] args) {
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[CampaignCreateRequest] campaignCreateRequest = ; // array[CampaignCreateRequest] | 

        try {
            CampaignCreateResponse result = apiInstance.campaigns/create(adAccountId, campaignCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[CampaignCreateRequest] *campaignCreateRequest = ; // 

// Create campaigns
[apiInstance campaigns/createWith:adAccountId
    campaignCreateRequest:campaignCreateRequest
              completionHandler: ^(CampaignCreateResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CampaignsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var campaignCreateRequest = ; // {array[CampaignCreateRequest]} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.campaigns/create(adAccountId, campaignCreateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class campaigns/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CampaignsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignCreateRequest = new array[CampaignCreateRequest](); // array[CampaignCreateRequest] | 

            try {
                // Create campaigns
                CampaignCreateResponse result = apiInstance.campaigns/create(adAccountId, campaignCreateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CampaignsApi.campaigns/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignCreateRequest = ; // array[CampaignCreateRequest] | 

try {
    $result = $api_instance->campaigns/create($adAccountId, $campaignCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignsApi->campaigns/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignCreateRequest = [WWW::OPenAPIClient::Object::array[CampaignCreateRequest]->new()]; # array[CampaignCreateRequest] | 

eval {
    my $result = $api_instance->campaigns/create(adAccountId => $adAccountId, campaignCreateRequest => $campaignCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CampaignsApi->campaigns/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignCreateRequest =  # array[CampaignCreateRequest] | 

try:
    # Create campaigns
    api_response = api_instance.campaigns/create(adAccountId, campaignCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CampaignsApi->campaigns/create: %s\n" % e)
extern crate CampaignsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignCreateRequest = ; // array[CampaignCreateRequest]

    let mut context = CampaignsApi::Context::default();
    let result = client.campaigns/create(adAccountId, campaignCreateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
campaignCreateRequest *

Array of campaigns.

Responses


campaigns/get

Get campaign

Get a specific campaign given the campaign ID.


/ad_accounts/{ad_account_id}/campaigns/{campaign_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns/{campaign_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;

import java.io.File;
import java.util.*;

public class CampaignsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String campaignId = campaignId_example; // String | Campaign ID, must be associated with the ad account ID provided in the path.

        try {
            CampaignResponse result = apiInstance.campaigns/get(adAccountId, campaignId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String campaignId = new String(); // String | Campaign ID, must be associated with the ad account ID provided in the path.

try {
    final result = await api_instance.campaigns/get(adAccountId, campaignId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->campaigns/get: $e\n');
}

import org.openapitools.client.api.CampaignsApi;

public class CampaignsApiExample {
    public static void main(String[] args) {
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String campaignId = campaignId_example; // String | Campaign ID, must be associated with the ad account ID provided in the path.

        try {
            CampaignResponse result = apiInstance.campaigns/get(adAccountId, campaignId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *campaignId = campaignId_example; // Campaign ID, must be associated with the ad account ID provided in the path. (default to null)

// Get campaign
[apiInstance campaigns/getWith:adAccountId
    campaignId:campaignId
              completionHandler: ^(CampaignResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CampaignsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var campaignId = campaignId_example; // {String} Campaign ID, must be associated with the ad account ID provided in the path.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.campaigns/get(adAccountId, campaignId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class campaigns/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CampaignsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignId = campaignId_example;  // String | Campaign ID, must be associated with the ad account ID provided in the path. (default to null)

            try {
                // Get campaign
                CampaignResponse result = apiInstance.campaigns/get(adAccountId, campaignId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CampaignsApi.campaigns/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignId = campaignId_example; // String | Campaign ID, must be associated with the ad account ID provided in the path.

try {
    $result = $api_instance->campaigns/get($adAccountId, $campaignId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignsApi->campaigns/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignId = campaignId_example; # String | Campaign ID, must be associated with the ad account ID provided in the path.

eval {
    my $result = $api_instance->campaigns/get(adAccountId => $adAccountId, campaignId => $campaignId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CampaignsApi->campaigns/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignId = campaignId_example # String | Campaign ID, must be associated with the ad account ID provided in the path. (default to null)

try:
    # Get campaign
    api_response = api_instance.campaigns/get(adAccountId, campaignId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CampaignsApi->campaigns/get: %s\n" % e)
extern crate CampaignsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignId = campaignId_example; // String

    let mut context = CampaignsApi::Context::default();
    let result = client.campaigns/get(adAccountId, campaignId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
campaign_id*
String
Campaign ID, must be associated with the ad account ID provided in the path.
Required

Responses


campaigns/list

List campaigns

Get a list of the campaigns in the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager.


/ad_accounts/{ad_account_id}/campaigns

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns?campaign_ids=&entity_statuses=&page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;

import java.io.File;
import java.util.*;

public class CampaignsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] entityStatuses = ; // array[String] | Entity status
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            campaigns_list_200_response result = apiInstance.campaigns/list(adAccountId, campaignIds, entityStatuses, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results.
final array[String] entityStatuses = new array[String](); // array[String] | Entity status
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.campaigns/list(adAccountId, campaignIds, entityStatuses, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->campaigns/list: $e\n');
}

import org.openapitools.client.api.CampaignsApi;

public class CampaignsApiExample {
    public static void main(String[] args) {
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
        array[String] entityStatuses = ; // array[String] | Entity status
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            campaigns_list_200_response result = apiInstance.campaigns/list(adAccountId, campaignIds, entityStatuses, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *campaignIds = ; // List of Campaign Ids to use to filter the results. (optional) (default to null)
array[String] *entityStatuses = ; // Entity status (optional) (default to ["ACTIVE","PAUSED"])
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// List campaigns
[apiInstance campaigns/listWith:adAccountId
    campaignIds:campaignIds
    entityStatuses:entityStatuses
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(campaigns_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CampaignsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'campaignIds': , // {array[String]} List of Campaign Ids to use to filter the results.
  'entityStatuses': , // {array[String]} Entity status
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.campaigns/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class campaigns/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CampaignsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignIds = new array[String](); // array[String] | List of Campaign Ids to use to filter the results. (optional)  (default to null)
            var entityStatuses = new array[String](); // array[String] | Entity status (optional)  (default to ["ACTIVE","PAUSED"])
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // List campaigns
                campaigns_list_200_response result = apiInstance.campaigns/list(adAccountId, campaignIds, entityStatuses, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CampaignsApi.campaigns/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignIds = ; // array[String] | List of Campaign Ids to use to filter the results.
$entityStatuses = ; // array[String] | Entity status
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->campaigns/list($adAccountId, $campaignIds, $entityStatuses, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignsApi->campaigns/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignIds = []; # array[String] | List of Campaign Ids to use to filter the results.
my $entityStatuses = []; # array[String] | Entity status
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->campaigns/list(adAccountId => $adAccountId, campaignIds => $campaignIds, entityStatuses => $entityStatuses, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CampaignsApi->campaigns/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignIds =  # array[String] | List of Campaign Ids to use to filter the results. (optional) (default to null)
entityStatuses =  # array[String] | Entity status (optional) (default to ["ACTIVE","PAUSED"])
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # List campaigns
    api_response = api_instance.campaigns/list(adAccountId, campaignIds=campaignIds, entityStatuses=entityStatuses, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CampaignsApi->campaigns/list: %s\n" % e)
extern crate CampaignsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignIds = ; // array[String]
    let entityStatuses = ; // array[String]
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = CampaignsApi::Context::default();
    let result = client.campaigns/list(adAccountId, campaignIds, entityStatuses, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
campaign_ids
array[String]
List of Campaign Ids to use to filter the results.
entity_statuses
array[String]
Entity status
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


campaigns/update

Update campaigns

Update multiple ad campaigns based on campaign_ids. <p/> <strong>Note:</strong><p/> - <p>The values for 'lifetime_spend_cap' and 'daily_spend_cap' are microcurrency amounts based on the currency field set in the advertiser's profile. (e.g. USD) <p/> <p>Microcurrency is used to track very small transactions, based on the currency set in the advertiser’s profile.</p> <p>A microcurrency unit is 10^(-6) of the standard unit of currency selected in the advertiser’s profile.</p> <p><strong>Equivalency equations</strong>, using dollars as an example currency:</p> <ul> <li>$1 = 1,000,000 microdollars</li> <li>1 microdollar = $0.000001 </li> </ul> <p><strong>To convert between currency and microcurrency</strong>, using dollars as an example currency:</p> <ul> <li>To convert dollars to microdollars, mutiply dollars by 1,000,000</li> <li>To convert microdollars to dollars, divide microdollars by 1,000,000</li> </ul>


/ad_accounts/{ad_account_id}/campaigns

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/campaigns" \
 -d '{
  "lifetime_spend_cap" : 1432744744,
  "end_time" : 1644023526,
  "is_flexible_daily_budgets" : true,
  "daily_spend_cap" : 1432744744,
  "objective_type" : "objective_type",
  "summary_status" : "summary_status",
  "is_campaign_budget_optimization" : true,
  "tracking_urls" : {
    "engagement" : [ "engagement", "engagement" ],
    "audience_verification" : [ "audience_verification", "audience_verification" ],
    "impression" : [ "impression", "impression" ],
    "buyable_button" : [ "buyable_button", "buyable_button" ],
    "click" : [ "click", "click" ]
  },
  "ad_account_id" : "549755885175",
  "is_automated_campaign" : true,
  "start_time" : 1580865126,
  "name" : "ACME Tools",
  "order_line_id" : "549755885175",
  "id" : "549755885175",
  "status" : "status"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CampaignsApi;

import java.io.File;
import java.util.*;

public class CampaignsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[CampaignUpdateRequest] campaignUpdateRequest = ; // array[CampaignUpdateRequest] | 

        try {
            CampaignUpdateResponse result = apiInstance.campaigns/update(adAccountId, campaignUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[CampaignUpdateRequest] campaignUpdateRequest = new array[CampaignUpdateRequest](); // array[CampaignUpdateRequest] | 

try {
    final result = await api_instance.campaigns/update(adAccountId, campaignUpdateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->campaigns/update: $e\n');
}

import org.openapitools.client.api.CampaignsApi;

public class CampaignsApiExample {
    public static void main(String[] args) {
        CampaignsApi apiInstance = new CampaignsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[CampaignUpdateRequest] campaignUpdateRequest = ; // array[CampaignUpdateRequest] | 

        try {
            CampaignUpdateResponse result = apiInstance.campaigns/update(adAccountId, campaignUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CampaignsApi#campaigns/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CampaignsApi *apiInstance = [[CampaignsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[CampaignUpdateRequest] *campaignUpdateRequest = ; // 

// Update campaigns
[apiInstance campaigns/updateWith:adAccountId
    campaignUpdateRequest:campaignUpdateRequest
              completionHandler: ^(CampaignUpdateResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CampaignsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var campaignUpdateRequest = ; // {array[CampaignUpdateRequest]} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.campaigns/update(adAccountId, campaignUpdateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class campaigns/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CampaignsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignUpdateRequest = new array[CampaignUpdateRequest](); // array[CampaignUpdateRequest] | 

            try {
                // Update campaigns
                CampaignUpdateResponse result = apiInstance.campaigns/update(adAccountId, campaignUpdateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CampaignsApi.campaigns/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CampaignsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignUpdateRequest = ; // array[CampaignUpdateRequest] | 

try {
    $result = $api_instance->campaigns/update($adAccountId, $campaignUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CampaignsApi->campaigns/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CampaignsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CampaignsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignUpdateRequest = [WWW::OPenAPIClient::Object::array[CampaignUpdateRequest]->new()]; # array[CampaignUpdateRequest] | 

eval {
    my $result = $api_instance->campaigns/update(adAccountId => $adAccountId, campaignUpdateRequest => $campaignUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CampaignsApi->campaigns/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CampaignsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignUpdateRequest =  # array[CampaignUpdateRequest] | 

try:
    # Update campaigns
    api_response = api_instance.campaigns/update(adAccountId, campaignUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CampaignsApi->campaigns/update: %s\n" % e)
extern crate CampaignsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignUpdateRequest = ; // array[CampaignUpdateRequest]

    let mut context = CampaignsApi::Context::default();
    let result = client.campaigns/update(adAccountId, campaignUpdateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
campaignUpdateRequest *

Array of campaigns.

Responses


Catalogs

catalogs/list

List catalogs

Fetch catalogs owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs?bookmark=bookmark_example&page_size=56&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_list_200_response result = apiInstance.catalogs/list(bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogs/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogs/list(bookmark, pageSize, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogs/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_list_200_response result = apiInstance.catalogs/list(bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogs/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List catalogs
[apiInstance catalogs/listWith:bookmark
    pageSize:pageSize
    adAccountId:adAccountId
              completionHandler: ^(catalogs_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogs/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogs/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List catalogs
                catalogs_list_200_response result = apiInstance.catalogs/list(bookmark, pageSize, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogs/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogs/list($bookmark, $pageSize, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogs/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogs/list(bookmark => $bookmark, pageSize => $pageSize, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogs/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List catalogs
    api_response = api_instance.catalogs/list(bookmark=bookmark, pageSize=pageSize, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogs/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogs/list(bookmark, pageSize, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroupPins/list

List products for a Product Group

Get a list of product pins for a given Catalogs Product Group Id owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups/{product_group_id}/products

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups/{product_group_id}/products?bookmark=bookmark_example&page_size=56&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_group_pins_list_200_response result = apiInstance.catalogsProductGroupPins/list(productGroupId, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroupPins/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String productGroupId = new String(); // String | Unique identifier of a product group
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroupPins/list(productGroupId, bookmark, pageSize, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroupPins/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_group_pins_list_200_response result = apiInstance.catalogsProductGroupPins/list(productGroupId, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroupPins/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *productGroupId = productGroupId_example; // Unique identifier of a product group (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List products for a Product Group
[apiInstance catalogsProductGroupPins/listWith:productGroupId
    bookmark:bookmark
    pageSize:pageSize
    adAccountId:adAccountId
              completionHandler: ^(catalogs_product_group_pins_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var productGroupId = productGroupId_example; // {String} Unique identifier of a product group
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogsProductGroupPins/list(productGroupId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroupPins/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var productGroupId = productGroupId_example;  // String | Unique identifier of a product group (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List products for a Product Group
                catalogs_product_group_pins_list_200_response result = apiInstance.catalogsProductGroupPins/list(productGroupId, bookmark, pageSize, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroupPins/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$productGroupId = productGroupId_example; // String | Unique identifier of a product group
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogsProductGroupPins/list($productGroupId, $bookmark, $pageSize, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroupPins/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $productGroupId = productGroupId_example; # String | Unique identifier of a product group
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogsProductGroupPins/list(productGroupId => $productGroupId, bookmark => $bookmark, pageSize => $pageSize, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroupPins/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
productGroupId = productGroupId_example # String | Unique identifier of a product group (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List products for a Product Group
    api_response = api_instance.catalogs_product_group_pins/list(productGroupId, bookmark=bookmark, pageSize=pageSize, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroupPins/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let productGroupId = productGroupId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroupPins/list(productGroupId, bookmark, pageSize, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
catalogs:read See all of your catalogs data
pins:read See your public Pins

Parameters

Path parameters
Name Description
product_group_id*
String
Unique identifier of a product group
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroups/create

Create product group

Create product group to use in Catalogs owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups?ad_account_id=adAccountId_example" \
 -d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        CatalogsProductGroupsCreateRequest catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}}; // CatalogsProductGroupsCreateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/create(catalogsProductGroupsCreateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final CatalogsProductGroupsCreateRequest catalogsProductGroupsCreateRequest = new CatalogsProductGroupsCreateRequest(); // CatalogsProductGroupsCreateRequest | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroups/create(catalogsProductGroupsCreateRequest, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroups/create: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        CatalogsProductGroupsCreateRequest catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}}; // CatalogsProductGroupsCreateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/create(catalogsProductGroupsCreateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
CatalogsProductGroupsCreateRequest *catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}}; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Create product group
[apiInstance catalogsProductGroups/createWith:catalogsProductGroupsCreateRequest
    adAccountId:adAccountId
              completionHandler: ^(catalogs_product_groups_create_201_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}}; // {CatalogsProductGroupsCreateRequest} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogsProductGroups/create(catalogsProductGroupsCreateRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroups/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var catalogsProductGroupsCreateRequest = new CatalogsProductGroupsCreateRequest(); // CatalogsProductGroupsCreateRequest | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Create product group
                catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/create(catalogsProductGroupsCreateRequest, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroups/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}}; // CatalogsProductGroupsCreateRequest | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogsProductGroups/create($catalogsProductGroupsCreateRequest, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroups/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $catalogsProductGroupsCreateRequest = WWW::OPenAPIClient::Object::CatalogsProductGroupsCreateRequest->new(); # CatalogsProductGroupsCreateRequest | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogsProductGroups/create(catalogsProductGroupsCreateRequest => $catalogsProductGroupsCreateRequest, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroups/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}} # CatalogsProductGroupsCreateRequest | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Create product group
    api_response = api_instance.catalogs_product_groups/create(catalogsProductGroupsCreateRequest, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroups/create: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let catalogsProductGroupsCreateRequest = {"name":"Few Filters using \"all_of\"","feed_id":"2680059592705","featured":false,"filters":{"all_of":[{"MIN_PRICE":{"values":999.99,"inclusion":true}},{"CURRENCY":{"values":"USD"}},{"CUSTOM_LABEL_0":{"values":["Luxury Items"]}}]}}; // CatalogsProductGroupsCreateRequest
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroups/create(catalogsProductGroupsCreateRequest, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:write Create, update, or delete your catalogs data

Parameters

Body parameters
Name Description
catalogsProductGroupsCreateRequest *

Request object used to created a catalogs product group.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroups/delete

Delete product group

Delete a product group owned by the "operation user_account" from being in use in Catalogs. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups/{product_group_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups/{product_group_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.catalogsProductGroups/delete(productGroupId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String productGroupId = new String(); // String | Unique identifier of a product group
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroups/delete(productGroupId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroups/delete: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.catalogsProductGroups/delete(productGroupId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *productGroupId = productGroupId_example; // Unique identifier of a product group (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Delete product group
[apiInstance catalogsProductGroups/deleteWith:productGroupId
    adAccountId:adAccountId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var productGroupId = productGroupId_example; // {String} Unique identifier of a product group
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.catalogsProductGroups/delete(productGroupId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroups/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var productGroupId = productGroupId_example;  // String | Unique identifier of a product group (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Delete product group
                apiInstance.catalogsProductGroups/delete(productGroupId, adAccountId);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroups/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$productGroupId = productGroupId_example; // String | Unique identifier of a product group
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $api_instance->catalogsProductGroups/delete($productGroupId, $adAccountId);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroups/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $productGroupId = productGroupId_example; # String | Unique identifier of a product group
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    $api_instance->catalogsProductGroups/delete(productGroupId => $productGroupId, adAccountId => $adAccountId);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroups/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
productGroupId = productGroupId_example # String | Unique identifier of a product group (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Delete product group
    api_instance.catalogs_product_groups/delete(productGroupId, adAccountId=adAccountId)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroups/delete: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let productGroupId = productGroupId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroups/delete(productGroupId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:write Create, update, or delete your catalogs data

Parameters

Path parameters
Name Description
product_group_id*
String
Unique identifier of a product group
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroups/get

Get product group

Get a singe product group for a given Catalogs Product Group Id owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups/{product_group_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups/{product_group_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/get(productGroupId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String productGroupId = new String(); // String | Unique identifier of a product group
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroups/get(productGroupId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroups/get: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/get(productGroupId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *productGroupId = productGroupId_example; // Unique identifier of a product group (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get product group
[apiInstance catalogsProductGroups/getWith:productGroupId
    adAccountId:adAccountId
              completionHandler: ^(catalogs_product_groups_create_201_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var productGroupId = productGroupId_example; // {String} Unique identifier of a product group
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogsProductGroups/get(productGroupId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroups/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var productGroupId = productGroupId_example;  // String | Unique identifier of a product group (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get product group
                catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/get(productGroupId, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroups/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$productGroupId = productGroupId_example; // String | Unique identifier of a product group
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogsProductGroups/get($productGroupId, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroups/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $productGroupId = productGroupId_example; # String | Unique identifier of a product group
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogsProductGroups/get(productGroupId => $productGroupId, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroups/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
productGroupId = productGroupId_example # String | Unique identifier of a product group (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get product group
    api_response = api_instance.catalogs_product_groups/get(productGroupId, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroups/get: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let productGroupId = productGroupId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroups/get(productGroupId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Path parameters
Name Description
product_group_id*
String
Unique identifier of a product group
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroups/list

List product groups

Get a list of product groups for a given Catalogs Feed Id owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups?feed_id=feedId_example&catalog_id=catalogId_example&bookmark=bookmark_example&page_size=56&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Filter entities for a given feed_id. If not given, all feeds are considered.
        String catalogId = catalogId_example; // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_list_200_response result = apiInstance.catalogsProductGroups/list(feedId, catalogId, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String feedId = new String(); // String | Filter entities for a given feed_id. If not given, all feeds are considered.
final String catalogId = new String(); // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroups/list(feedId, catalogId, bookmark, pageSize, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroups/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Filter entities for a given feed_id. If not given, all feeds are considered.
        String catalogId = catalogId_example; // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_list_200_response result = apiInstance.catalogsProductGroups/list(feedId, catalogId, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *feedId = feedId_example; // Filter entities for a given feed_id. If not given, all feeds are considered. (optional) (default to null)
String *catalogId = catalogId_example; // Filter entities for a given catalog_id. If not given, all catalogs are considered. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List product groups
[apiInstance catalogsProductGroups/listWith:feedId
    catalogId:catalogId
    bookmark:bookmark
    pageSize:pageSize
    adAccountId:adAccountId
              completionHandler: ^(catalogs_product_groups_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var opts = {
  'feedId': feedId_example, // {String} Filter entities for a given feed_id. If not given, all feeds are considered.
  'catalogId': catalogId_example, // {String} Filter entities for a given catalog_id. If not given, all catalogs are considered.
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogsProductGroups/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroups/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var feedId = feedId_example;  // String | Filter entities for a given feed_id. If not given, all feeds are considered. (optional)  (default to null)
            var catalogId = catalogId_example;  // String | Filter entities for a given catalog_id. If not given, all catalogs are considered. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List product groups
                catalogs_product_groups_list_200_response result = apiInstance.catalogsProductGroups/list(feedId, catalogId, bookmark, pageSize, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroups/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$feedId = feedId_example; // String | Filter entities for a given feed_id. If not given, all feeds are considered.
$catalogId = catalogId_example; // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogsProductGroups/list($feedId, $catalogId, $bookmark, $pageSize, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroups/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $feedId = feedId_example; # String | Filter entities for a given feed_id. If not given, all feeds are considered.
my $catalogId = catalogId_example; # String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogsProductGroups/list(feedId => $feedId, catalogId => $catalogId, bookmark => $bookmark, pageSize => $pageSize, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroups/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
feedId = feedId_example # String | Filter entities for a given feed_id. If not given, all feeds are considered. (optional) (default to null)
catalogId = catalogId_example # String | Filter entities for a given catalog_id. If not given, all catalogs are considered. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List product groups
    api_response = api_instance.catalogs_product_groups/list(feedId=feedId, catalogId=catalogId, bookmark=bookmark, pageSize=pageSize, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroups/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let feedId = feedId_example; // String
    let catalogId = catalogId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroups/list(feedId, catalogId, bookmark, pageSize, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Query parameters
Name Description
feed_id
String
Filter entities for a given feed_id. If not given, all feeds are considered.
catalog_id
String
Filter entities for a given catalog_id. If not given, all catalogs are considered.
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroups/productCountsGet

Get product counts for a Product Group

Get a product counts for a given Catalogs Product Group owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups/{product_group_id}/product_counts

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups/{product_group_id}/product_counts?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsProductGroupProductCounts result = apiInstance.catalogsProductGroups/productCountsGet(productGroupId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/productCountsGet");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String productGroupId = new String(); // String | Unique identifier of a product group
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroups/productCountsGet(productGroupId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroups/productCountsGet: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsProductGroupProductCounts result = apiInstance.catalogsProductGroups/productCountsGet(productGroupId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/productCountsGet");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *productGroupId = productGroupId_example; // Unique identifier of a product group (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get product counts for a Product Group
[apiInstance catalogsProductGroups/productCountsGetWith:productGroupId
    adAccountId:adAccountId
              completionHandler: ^(CatalogsProductGroupProductCounts output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var productGroupId = productGroupId_example; // {String} Unique identifier of a product group
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogsProductGroups/productCountsGet(productGroupId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroups/productCountsGetExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var productGroupId = productGroupId_example;  // String | Unique identifier of a product group (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get product counts for a Product Group
                CatalogsProductGroupProductCounts result = apiInstance.catalogsProductGroups/productCountsGet(productGroupId, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroups/productCountsGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$productGroupId = productGroupId_example; // String | Unique identifier of a product group
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogsProductGroups/productCountsGet($productGroupId, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroups/productCountsGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $productGroupId = productGroupId_example; # String | Unique identifier of a product group
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogsProductGroups/productCountsGet(productGroupId => $productGroupId, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroups/productCountsGet: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
productGroupId = productGroupId_example # String | Unique identifier of a product group (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get product counts for a Product Group
    api_response = api_instance.catalogs_product_groups/product_counts_get(productGroupId, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroups/productCountsGet: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let productGroupId = productGroupId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroups/productCountsGet(productGroupId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Path parameters
Name Description
product_group_id*
String
Unique identifier of a product group
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


catalogsProductGroups/update

Update product group

Update product group owned by the "operation user_account" to use in Catalogs. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/product_groups/{product_group_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/catalogs/product_groups/{product_group_id}?ad_account_id=adAccountId_example" \
 -d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        CatalogsProductGroupsUpdateRequest catalogsProductGroupsUpdateRequest = ; // CatalogsProductGroupsUpdateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/update(productGroupId, catalogsProductGroupsUpdateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String productGroupId = new String(); // String | Unique identifier of a product group
final CatalogsProductGroupsUpdateRequest catalogsProductGroupsUpdateRequest = new CatalogsProductGroupsUpdateRequest(); // CatalogsProductGroupsUpdateRequest | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.catalogsProductGroups/update(productGroupId, catalogsProductGroupsUpdateRequest, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->catalogsProductGroups/update: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String productGroupId = productGroupId_example; // String | Unique identifier of a product group
        CatalogsProductGroupsUpdateRequest catalogsProductGroupsUpdateRequest = ; // CatalogsProductGroupsUpdateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/update(productGroupId, catalogsProductGroupsUpdateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#catalogsProductGroups/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *productGroupId = productGroupId_example; // Unique identifier of a product group (default to null)
CatalogsProductGroupsUpdateRequest *catalogsProductGroupsUpdateRequest = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Update product group
[apiInstance catalogsProductGroups/updateWith:productGroupId
    catalogsProductGroupsUpdateRequest:catalogsProductGroupsUpdateRequest
    adAccountId:adAccountId
              completionHandler: ^(catalogs_product_groups_create_201_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var productGroupId = productGroupId_example; // {String} Unique identifier of a product group
var catalogsProductGroupsUpdateRequest = ; // {CatalogsProductGroupsUpdateRequest} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.catalogsProductGroups/update(productGroupId, catalogsProductGroupsUpdateRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class catalogsProductGroups/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var productGroupId = productGroupId_example;  // String | Unique identifier of a product group (default to null)
            var catalogsProductGroupsUpdateRequest = new CatalogsProductGroupsUpdateRequest(); // CatalogsProductGroupsUpdateRequest | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Update product group
                catalogs_product_groups_create_201_response result = apiInstance.catalogsProductGroups/update(productGroupId, catalogsProductGroupsUpdateRequest, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.catalogsProductGroups/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$productGroupId = productGroupId_example; // String | Unique identifier of a product group
$catalogsProductGroupsUpdateRequest = ; // CatalogsProductGroupsUpdateRequest | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->catalogsProductGroups/update($productGroupId, $catalogsProductGroupsUpdateRequest, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->catalogsProductGroups/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $productGroupId = productGroupId_example; # String | Unique identifier of a product group
my $catalogsProductGroupsUpdateRequest = WWW::OPenAPIClient::Object::CatalogsProductGroupsUpdateRequest->new(); # CatalogsProductGroupsUpdateRequest | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->catalogsProductGroups/update(productGroupId => $productGroupId, catalogsProductGroupsUpdateRequest => $catalogsProductGroupsUpdateRequest, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->catalogsProductGroups/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
productGroupId = productGroupId_example # String | Unique identifier of a product group (default to null)
catalogsProductGroupsUpdateRequest =  # CatalogsProductGroupsUpdateRequest | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Update product group
    api_response = api_instance.catalogs_product_groups/update(productGroupId, catalogsProductGroupsUpdateRequest, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->catalogsProductGroups/update: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let productGroupId = productGroupId_example; // String
    let catalogsProductGroupsUpdateRequest = ; // CatalogsProductGroupsUpdateRequest
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.catalogsProductGroups/update(productGroupId, catalogsProductGroupsUpdateRequest, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:write Create, update, or delete your catalogs data

Parameters

Path parameters
Name Description
product_group_id*
String
Unique identifier of a product group
Required
Body parameters
Name Description
catalogsProductGroupsUpdateRequest *

Request object used to Update a catalogs product group.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


feedProcessingResults/list

List processing results for a given feed

Fetch a feed processing results owned by the "operation user_account". Please note that for now the bookmark parameter is not functional and only the first page will be available until it is implemented in some release in the near future. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/feeds/{feed_id}/processing_results

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/feeds/{feed_id}/processing_results?bookmark=bookmark_example&page_size=56&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            feed_processing_results_list_200_response result = apiInstance.feedProcessingResults/list(feedId, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feedProcessingResults/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String feedId = new String(); // String | Unique identifier of a feed
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.feedProcessingResults/list(feedId, bookmark, pageSize, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->feedProcessingResults/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            feed_processing_results_list_200_response result = apiInstance.feedProcessingResults/list(feedId, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feedProcessingResults/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *feedId = feedId_example; // Unique identifier of a feed (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List processing results for a given feed
[apiInstance feedProcessingResults/listWith:feedId
    bookmark:bookmark
    pageSize:pageSize
    adAccountId:adAccountId
              completionHandler: ^(feed_processing_results_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var feedId = feedId_example; // {String} Unique identifier of a feed
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.feedProcessingResults/list(feedId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class feedProcessingResults/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var feedId = feedId_example;  // String | Unique identifier of a feed (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List processing results for a given feed
                feed_processing_results_list_200_response result = apiInstance.feedProcessingResults/list(feedId, bookmark, pageSize, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.feedProcessingResults/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$feedId = feedId_example; // String | Unique identifier of a feed
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->feedProcessingResults/list($feedId, $bookmark, $pageSize, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->feedProcessingResults/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $feedId = feedId_example; # String | Unique identifier of a feed
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->feedProcessingResults/list(feedId => $feedId, bookmark => $bookmark, pageSize => $pageSize, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->feedProcessingResults/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
feedId = feedId_example # String | Unique identifier of a feed (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List processing results for a given feed
    api_response = api_instance.feed_processing_results/list(feedId, bookmark=bookmark, pageSize=pageSize, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->feedProcessingResults/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let feedId = feedId_example; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.feedProcessingResults/list(feedId, bookmark, pageSize, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Path parameters
Name Description
feed_id*
String
Unique identifier of a feed
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
ad_account_id
String
Unique identifier of an ad account.

Responses


feeds/create

Create feed

Create a new feed owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Please, be aware that "default_country" and "default_locale" are not required in the spec for forward compatibility but for now the API will not accept requests without those fields. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. For Retail partners, refer to <a href='https://help.pinterest.com/en/business/article/before-you-get-started-with-catalogs'>Before you get started with Catalogs</a>. For Hotel parterns, refer to <a href='/docs/shopping/catalog/'>Pinterest API for shopping</a>.


/catalogs/feeds

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/catalogs/feeds?ad_account_id=adAccountId_example" \
 -d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        FeedsCreateRequest feedsCreateRequest = ; // FeedsCreateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsFeed result = apiInstance.feeds/create(feedsCreateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final FeedsCreateRequest feedsCreateRequest = new FeedsCreateRequest(); // FeedsCreateRequest | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.feeds/create(feedsCreateRequest, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->feeds/create: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        FeedsCreateRequest feedsCreateRequest = ; // FeedsCreateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsFeed result = apiInstance.feeds/create(feedsCreateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
FeedsCreateRequest *feedsCreateRequest = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Create feed
[apiInstance feeds/createWith:feedsCreateRequest
    adAccountId:adAccountId
              completionHandler: ^(CatalogsFeed output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var feedsCreateRequest = ; // {FeedsCreateRequest} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.feeds/create(feedsCreateRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class feeds/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var feedsCreateRequest = new FeedsCreateRequest(); // FeedsCreateRequest | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Create feed
                CatalogsFeed result = apiInstance.feeds/create(feedsCreateRequest, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.feeds/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$feedsCreateRequest = ; // FeedsCreateRequest | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->feeds/create($feedsCreateRequest, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->feeds/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $feedsCreateRequest = WWW::OPenAPIClient::Object::FeedsCreateRequest->new(); # FeedsCreateRequest | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->feeds/create(feedsCreateRequest => $feedsCreateRequest, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->feeds/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
feedsCreateRequest =  # FeedsCreateRequest | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Create feed
    api_response = api_instance.feeds/create(feedsCreateRequest, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->feeds/create: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let feedsCreateRequest = ; // FeedsCreateRequest
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.feeds/create(feedsCreateRequest, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data
catalogs:write Create, update, or delete your catalogs data

Parameters

Body parameters
Name Description
feedsCreateRequest *

Request object used to created a feed.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


feeds/delete

Delete feed

Delete a feed owned by the "operating user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. For Retail partners, refer to <a href='https://help.pinterest.com/en/business/article/before-you-get-started-with-catalogs'>Before you get started with Catalogs</a>. For Hotel parterns, refer to <a href='/docs/shopping/catalog/'>Pinterest API for shopping</a>.


/catalogs/feeds/{feed_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/feeds/{feed_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.feeds/delete(feedId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String feedId = new String(); // String | Unique identifier of a feed
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.feeds/delete(feedId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->feeds/delete: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.feeds/delete(feedId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *feedId = feedId_example; // Unique identifier of a feed (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Delete feed
[apiInstance feeds/deleteWith:feedId
    adAccountId:adAccountId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var feedId = feedId_example; // {String} Unique identifier of a feed
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.feeds/delete(feedId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class feeds/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var feedId = feedId_example;  // String | Unique identifier of a feed (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Delete feed
                apiInstance.feeds/delete(feedId, adAccountId);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.feeds/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$feedId = feedId_example; // String | Unique identifier of a feed
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $api_instance->feeds/delete($feedId, $adAccountId);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->feeds/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $feedId = feedId_example; # String | Unique identifier of a feed
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    $api_instance->feeds/delete(feedId => $feedId, adAccountId => $adAccountId);
};
if ($@) {
    warn "Exception when calling CatalogsApi->feeds/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
feedId = feedId_example # String | Unique identifier of a feed (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Delete feed
    api_instance.feeds/delete(feedId, adAccountId=adAccountId)
except ApiException as e:
    print("Exception when calling CatalogsApi->feeds/delete: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let feedId = feedId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.feeds/delete(feedId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data
catalogs:write Create, update, or delete your catalogs data

Parameters

Path parameters
Name Description
feed_id*
String
Unique identifier of a feed
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


feeds/get

Get feed

Get a single feed owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. For Retail partners, refer to <a href='https://help.pinterest.com/en/business/article/before-you-get-started-with-catalogs'>Before you get started with Catalogs</a>. For Hotel parterns, refer to <a href='/docs/shopping/catalog/'>Pinterest API for shopping</a>.


/catalogs/feeds/{feed_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/feeds/{feed_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsFeed result = apiInstance.feeds/get(feedId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String feedId = new String(); // String | Unique identifier of a feed
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.feeds/get(feedId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->feeds/get: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsFeed result = apiInstance.feeds/get(feedId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *feedId = feedId_example; // Unique identifier of a feed (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get feed
[apiInstance feeds/getWith:feedId
    adAccountId:adAccountId
              completionHandler: ^(CatalogsFeed output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var feedId = feedId_example; // {String} Unique identifier of a feed
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.feeds/get(feedId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class feeds/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var feedId = feedId_example;  // String | Unique identifier of a feed (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get feed
                CatalogsFeed result = apiInstance.feeds/get(feedId, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.feeds/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$feedId = feedId_example; // String | Unique identifier of a feed
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->feeds/get($feedId, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->feeds/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $feedId = feedId_example; # String | Unique identifier of a feed
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->feeds/get(feedId => $feedId, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->feeds/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
feedId = feedId_example # String | Unique identifier of a feed (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get feed
    api_response = api_instance.feeds/get(feedId, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->feeds/get: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let feedId = feedId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.feeds/get(feedId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Path parameters
Name Description
feed_id*
String
Unique identifier of a feed
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


feeds/list

List feeds

Fetch feeds owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. For Retail partners, refer to <a href='https://help.pinterest.com/en/business/article/before-you-get-started-with-catalogs'>Before you get started with Catalogs</a>. For Hotel parterns, refer to <a href='/docs/shopping/catalog/'>Pinterest API for shopping</a>.


/catalogs/feeds

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/feeds?bookmark=bookmark_example&page_size=56&catalog_id=catalogId_example&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String catalogId = catalogId_example; // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            feeds_list_200_response result = apiInstance.feeds/list(bookmark, pageSize, catalogId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String catalogId = new String(); // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.feeds/list(bookmark, pageSize, catalogId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->feeds/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String catalogId = catalogId_example; // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            feeds_list_200_response result = apiInstance.feeds/list(bookmark, pageSize, catalogId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *catalogId = catalogId_example; // Filter entities for a given catalog_id. If not given, all catalogs are considered. (optional) (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List feeds
[apiInstance feeds/listWith:bookmark
    pageSize:pageSize
    catalogId:catalogId
    adAccountId:adAccountId
              completionHandler: ^(feeds_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'catalogId': catalogId_example, // {String} Filter entities for a given catalog_id. If not given, all catalogs are considered.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.feeds/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class feeds/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var catalogId = catalogId_example;  // String | Filter entities for a given catalog_id. If not given, all catalogs are considered. (optional)  (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List feeds
                feeds_list_200_response result = apiInstance.feeds/list(bookmark, pageSize, catalogId, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.feeds/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$catalogId = catalogId_example; // String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->feeds/list($bookmark, $pageSize, $catalogId, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->feeds/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $catalogId = catalogId_example; # String | Filter entities for a given catalog_id. If not given, all catalogs are considered.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->feeds/list(bookmark => $bookmark, pageSize => $pageSize, catalogId => $catalogId, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->feeds/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
catalogId = catalogId_example # String | Filter entities for a given catalog_id. If not given, all catalogs are considered. (optional) (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List feeds
    api_response = api_instance.feeds/list(bookmark=bookmark, pageSize=pageSize, catalogId=catalogId, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->feeds/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let catalogId = catalogId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.feeds/list(bookmark, pageSize, catalogId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
catalog_id
String
Filter entities for a given catalog_id. If not given, all catalogs are considered.
ad_account_id
String
Unique identifier of an ad account.

Responses


feeds/update

Update feed

Update a feed owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. For Retail partners, refer to <a href='https://help.pinterest.com/en/business/article/before-you-get-started-with-catalogs'>Before you get started with Catalogs</a>. For Hotel parterns, refer to <a href='/docs/shopping/catalog/'>Pinterest API for shopping</a>.


/catalogs/feeds/{feed_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/catalogs/feeds/{feed_id}?ad_account_id=adAccountId_example" \
 -d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        FeedsUpdateRequest feedsUpdateRequest = ; // FeedsUpdateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsFeed result = apiInstance.feeds/update(feedId, feedsUpdateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String feedId = new String(); // String | Unique identifier of a feed
final FeedsUpdateRequest feedsUpdateRequest = new FeedsUpdateRequest(); // FeedsUpdateRequest | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.feeds/update(feedId, feedsUpdateRequest, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->feeds/update: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String feedId = feedId_example; // String | Unique identifier of a feed
        FeedsUpdateRequest feedsUpdateRequest = ; // FeedsUpdateRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsFeed result = apiInstance.feeds/update(feedId, feedsUpdateRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#feeds/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *feedId = feedId_example; // Unique identifier of a feed (default to null)
FeedsUpdateRequest *feedsUpdateRequest = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Update feed
[apiInstance feeds/updateWith:feedId
    feedsUpdateRequest:feedsUpdateRequest
    adAccountId:adAccountId
              completionHandler: ^(CatalogsFeed output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var feedId = feedId_example; // {String} Unique identifier of a feed
var feedsUpdateRequest = ; // {FeedsUpdateRequest} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.feeds/update(feedId, feedsUpdateRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class feeds/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var feedId = feedId_example;  // String | Unique identifier of a feed (default to null)
            var feedsUpdateRequest = new FeedsUpdateRequest(); // FeedsUpdateRequest | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Update feed
                CatalogsFeed result = apiInstance.feeds/update(feedId, feedsUpdateRequest, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.feeds/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$feedId = feedId_example; // String | Unique identifier of a feed
$feedsUpdateRequest = ; // FeedsUpdateRequest | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->feeds/update($feedId, $feedsUpdateRequest, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->feeds/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $feedId = feedId_example; # String | Unique identifier of a feed
my $feedsUpdateRequest = WWW::OPenAPIClient::Object::FeedsUpdateRequest->new(); # FeedsUpdateRequest | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->feeds/update(feedId => $feedId, feedsUpdateRequest => $feedsUpdateRequest, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->feeds/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
feedId = feedId_example # String | Unique identifier of a feed (default to null)
feedsUpdateRequest =  # FeedsUpdateRequest | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Update feed
    api_response = api_instance.feeds/update(feedId, feedsUpdateRequest, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->feeds/update: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let feedId = feedId_example; // String
    let feedsUpdateRequest = ; // FeedsUpdateRequest
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.feeds/update(feedId, feedsUpdateRequest, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data
catalogs:write Create, update, or delete your catalogs data

Parameters

Path parameters
Name Description
feed_id*
String
Unique identifier of a feed
Required
Body parameters
Name Description
feedsUpdateRequest *

Request object used to update a feed.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


items/get

Get catalogs items

Get the items of the catalog owned by the "operation user_account". <a href="/docs/shopping/catalog/#Update%20items%20in%20batch" target="_blank">See detailed documentation here.</a> - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager.


/catalogs/items

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/items?ad_account_id=adAccountId_example&country=US&language=EN&item_ids=["CR123"]&filters="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String country = US; // String | Country for the Catalogs Items
        String language = EN; // String | Language for the Catalogs Items
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] itemIds = ["CR123"]; // array[String] | This parameter is deprecated. Use filters instead.
        CatalogsItemsFilters filters = ; // CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter.

        try {
            CatalogsItems result = apiInstance.items/get(country, language, adAccountId, itemIds, filters);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#items/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String country = new String(); // String | Country for the Catalogs Items
final String language = new String(); // String | Language for the Catalogs Items
final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] itemIds = new array[String](); // array[String] | This parameter is deprecated. Use filters instead.
final CatalogsItemsFilters filters = new CatalogsItemsFilters(); // CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter.

try {
    final result = await api_instance.items/get(country, language, adAccountId, itemIds, filters);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->items/get: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String country = US; // String | Country for the Catalogs Items
        String language = EN; // String | Language for the Catalogs Items
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] itemIds = ["CR123"]; // array[String] | This parameter is deprecated. Use filters instead.
        CatalogsItemsFilters filters = ; // CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter.

        try {
            CatalogsItems result = apiInstance.items/get(country, language, adAccountId, itemIds, filters);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#items/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *country = US; // Country for the Catalogs Items (default to null)
String *language = EN; // Language for the Catalogs Items (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)
array[String] *itemIds = ["CR123"]; // This parameter is deprecated. Use filters instead. (optional) (default to null)
CatalogsItemsFilters *filters = ; // Identifies items to be retrieved. This is a required parameter. (optional) (default to null)

// Get catalogs items
[apiInstance items/getWith:country
    language:language
    adAccountId:adAccountId
    itemIds:itemIds
    filters:filters
              completionHandler: ^(CatalogsItems output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var country = US; // {String} Country for the Catalogs Items
var language = EN; // {String} Language for the Catalogs Items
var opts = {
  'adAccountId': adAccountId_example, // {String} Unique identifier of an ad account.
  'itemIds': ["CR123"], // {array[String]} This parameter is deprecated. Use filters instead.
  'filters':  // {CatalogsItemsFilters} Identifies items to be retrieved. This is a required parameter.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.items/get(country, language, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class items/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var country = US;  // String | Country for the Catalogs Items (default to null)
            var language = EN;  // String | Language for the Catalogs Items (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)
            var itemIds = new array[String](); // array[String] | This parameter is deprecated. Use filters instead. (optional)  (default to null)
            var filters = new CatalogsItemsFilters(); // CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter. (optional)  (default to null)

            try {
                // Get catalogs items
                CatalogsItems result = apiInstance.items/get(country, language, adAccountId, itemIds, filters);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.items/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$country = US; // String | Country for the Catalogs Items
$language = EN; // String | Language for the Catalogs Items
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$itemIds = ["CR123"]; // array[String] | This parameter is deprecated. Use filters instead.
$filters = ; // CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter.

try {
    $result = $api_instance->items/get($country, $language, $adAccountId, $itemIds, $filters);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->items/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $country = US; # String | Country for the Catalogs Items
my $language = EN; # String | Language for the Catalogs Items
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $itemIds = [["CR123"]]; # array[String] | This parameter is deprecated. Use filters instead.
my $filters = ; # CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter.

eval {
    my $result = $api_instance->items/get(country => $country, language => $language, adAccountId => $adAccountId, itemIds => $itemIds, filters => $filters);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->items/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
country = US # String | Country for the Catalogs Items (default to null)
language = EN # String | Language for the Catalogs Items (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)
itemIds = ["CR123"] # array[String] | This parameter is deprecated. Use filters instead. (optional) (default to null)
filters =  # CatalogsItemsFilters | Identifies items to be retrieved. This is a required parameter. (optional) (default to null)

try:
    # Get catalogs items
    api_response = api_instance.items/get(country, language, adAccountId=adAccountId, itemIds=itemIds, filters=filters)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->items/get: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let country = US; // String
    let language = EN; // String
    let adAccountId = adAccountId_example; // String
    let itemIds = ["CR123"]; // array[String]
    let filters = ; // CatalogsItemsFilters

    let mut context = CatalogsApi::Context::default();
    let result = client.items/get(country, language, adAccountId, itemIds, filters, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.
country*
String
Country for the Catalogs Items
Required
language*
String
Language for the Catalogs Items
Required
item_ids
array[String]
This parameter is deprecated. Use filters instead.
filters
CatalogsItemsFilters
Identifies items to be retrieved. This is a required parameter.

Responses


itemsBatch/get

Get catalogs item batch status

Get a single catalogs items batch owned by the "operating user_account". <a href="/docs/shopping/catalog/#Update%20items%20in%20batch" target="_blank">See detailed documentation here.</a> - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager.


/catalogs/items/batch/{batch_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/items/batch/{batch_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; // String | Id of a catalogs items batch to fetch
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsItemsBatch result = apiInstance.itemsBatch/get(batchId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#itemsBatch/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String batchId = new String(); // String | Id of a catalogs items batch to fetch
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.itemsBatch/get(batchId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->itemsBatch/get: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; // String | Id of a catalogs items batch to fetch
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsItemsBatch result = apiInstance.itemsBatch/get(batchId, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#itemsBatch/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; // Id of a catalogs items batch to fetch (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get catalogs item batch status
[apiInstance itemsBatch/getWith:batchId
    adAccountId:adAccountId
              completionHandler: ^(CatalogsItemsBatch output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; // {String} Id of a catalogs items batch to fetch
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.itemsBatch/get(batchId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class itemsBatch/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e;  // String | Id of a catalogs items batch to fetch (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get catalogs item batch status
                CatalogsItemsBatch result = apiInstance.itemsBatch/get(batchId, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.itemsBatch/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; // String | Id of a catalogs items batch to fetch
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->itemsBatch/get($batchId, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->itemsBatch/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; # String | Id of a catalogs items batch to fetch
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->itemsBatch/get(batchId => $batchId, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->itemsBatch/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e # String | Id of a catalogs items batch to fetch (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get catalogs item batch status
    api_response = api_instance.items_batch/get(batchId, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->itemsBatch/get: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let batchId = 595953100599279259-66753b9bb65c46c49bd8503b27fecf9e; // String
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.itemsBatch/get(batchId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Path parameters
Name Description
batch_id*
String
Id of a catalogs items batch to fetch
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


itemsBatch/post

Operate on item batch

This endpoint supports multiple operations on a set of one or more catalog items owned by the "operation user_account". <a href="/docs/shopping/catalog/#Update%20items%20in%20batch" target="_blank">See detailed documentation here.</a> - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager.


/catalogs/items/batch

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/catalogs/items/batch?ad_account_id=adAccountId_example" \
 -d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        ItemsBatchPostRequest itemsBatchPostRequest = ; // ItemsBatchPostRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsItemsBatch result = apiInstance.itemsBatch/post(itemsBatchPostRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#itemsBatch/post");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final ItemsBatchPostRequest itemsBatchPostRequest = new ItemsBatchPostRequest(); // ItemsBatchPostRequest | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.itemsBatch/post(itemsBatchPostRequest, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->itemsBatch/post: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        ItemsBatchPostRequest itemsBatchPostRequest = ; // ItemsBatchPostRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            CatalogsItemsBatch result = apiInstance.itemsBatch/post(itemsBatchPostRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#itemsBatch/post");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
ItemsBatchPostRequest *itemsBatchPostRequest = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Operate on item batch
[apiInstance itemsBatch/postWith:itemsBatchPostRequest
    adAccountId:adAccountId
              completionHandler: ^(CatalogsItemsBatch output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var itemsBatchPostRequest = ; // {ItemsBatchPostRequest} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.itemsBatch/post(itemsBatchPostRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class itemsBatch/postExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var itemsBatchPostRequest = new ItemsBatchPostRequest(); // ItemsBatchPostRequest | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Operate on item batch
                CatalogsItemsBatch result = apiInstance.itemsBatch/post(itemsBatchPostRequest, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.itemsBatch/post: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$itemsBatchPostRequest = ; // ItemsBatchPostRequest | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->itemsBatch/post($itemsBatchPostRequest, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->itemsBatch/post: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $itemsBatchPostRequest = WWW::OPenAPIClient::Object::ItemsBatchPostRequest->new(); # ItemsBatchPostRequest | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->itemsBatch/post(itemsBatchPostRequest => $itemsBatchPostRequest, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->itemsBatch/post: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
itemsBatchPostRequest =  # ItemsBatchPostRequest | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Operate on item batch
    api_response = api_instance.items_batch/post(itemsBatchPostRequest, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->itemsBatch/post: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let itemsBatchPostRequest = ; // ItemsBatchPostRequest
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.itemsBatch/post(itemsBatchPostRequest, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data
catalogs:write Create, update, or delete your catalogs data

Parameters

Body parameters
Name Description
itemsBatchPostRequest *

Request object used to create catalogs items in a batch

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


itemsIssues/list

List item issues for a given processing result

List item validation issues for a given feed processing result owned by the "operation user_account". Up to 20 random samples of affected items are returned for each error and warning code. Please note that for now query parameters 'item_numbers' and 'item_validation_issue' cannot be used simultaneously until it is implemented in some release in the future. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/processing_results/{processing_result_id}/item_issues

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/catalogs/processing_results/{processing_result_id}/item_issues?bookmark=bookmark_example&page_size=56&item_numbers=[1,5]&item_validation_issue=TITLE_MISSING&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        String processingResultId = 5224831246441439241; // String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        array[Integer] itemNumbers = [1,5]; // array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
        CatalogsItemValidationIssue itemValidationIssue = TITLE_MISSING; // CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            items_issues_list_200_response result = apiInstance.itemsIssues/list(processingResultId, bookmark, pageSize, itemNumbers, itemValidationIssue, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#itemsIssues/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String processingResultId = new String(); // String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final array[Integer] itemNumbers = new array[Integer](); // array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
final CatalogsItemValidationIssue itemValidationIssue = new CatalogsItemValidationIssue(); // CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.itemsIssues/list(processingResultId, bookmark, pageSize, itemNumbers, itemValidationIssue, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->itemsIssues/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        String processingResultId = 5224831246441439241; // String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        array[Integer] itemNumbers = [1,5]; // array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
        CatalogsItemValidationIssue itemValidationIssue = TITLE_MISSING; // CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            items_issues_list_200_response result = apiInstance.itemsIssues/list(processingResultId, bookmark, pageSize, itemNumbers, itemValidationIssue, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#itemsIssues/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
String *processingResultId = 5224831246441439241; // Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list). (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
array[Integer] *itemNumbers = [1,5]; // Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation. (optional) (default to null)
CatalogsItemValidationIssue *itemValidationIssue = TITLE_MISSING; // Filter item validation issues that have a given type of item validation issue. (optional) (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List item issues for a given processing result
[apiInstance itemsIssues/listWith:processingResultId
    bookmark:bookmark
    pageSize:pageSize
    itemNumbers:itemNumbers
    itemValidationIssue:itemValidationIssue
    adAccountId:adAccountId
              completionHandler: ^(items_issues_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var processingResultId = 5224831246441439241; // {String} Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'itemNumbers': [1,5], // {array[Integer]} Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
  'itemValidationIssue': TITLE_MISSING, // {CatalogsItemValidationIssue} Filter item validation issues that have a given type of item validation issue.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.itemsIssues/list(processingResultId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class itemsIssues/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var processingResultId = 5224831246441439241;  // String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list). (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var itemNumbers = new array[Integer](); // array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation. (optional)  (default to null)
            var itemValidationIssue = new CatalogsItemValidationIssue(); // CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue. (optional)  (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List item issues for a given processing result
                items_issues_list_200_response result = apiInstance.itemsIssues/list(processingResultId, bookmark, pageSize, itemNumbers, itemValidationIssue, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.itemsIssues/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$processingResultId = 5224831246441439241; // String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$itemNumbers = [1,5]; // array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
$itemValidationIssue = TITLE_MISSING; // CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->itemsIssues/list($processingResultId, $bookmark, $pageSize, $itemNumbers, $itemValidationIssue, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->itemsIssues/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $processingResultId = 5224831246441439241; # String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $itemNumbers = [[1,5]]; # array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
my $itemValidationIssue = TITLE_MISSING; # CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->itemsIssues/list(processingResultId => $processingResultId, bookmark => $bookmark, pageSize => $pageSize, itemNumbers => $itemNumbers, itemValidationIssue => $itemValidationIssue, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->itemsIssues/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
processingResultId = 5224831246441439241 # String | Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list). (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
itemNumbers = [1,5] # array[Integer] | Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation. (optional) (default to null)
itemValidationIssue = TITLE_MISSING # CatalogsItemValidationIssue | Filter item validation issues that have a given type of item validation issue. (optional) (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List item issues for a given processing result
    api_response = api_instance.items_issues/list(processingResultId, bookmark=bookmark, pageSize=pageSize, itemNumbers=itemNumbers, itemValidationIssue=itemValidationIssue, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->itemsIssues/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let processingResultId = 5224831246441439241; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let itemNumbers = [1,5]; // array[Integer]
    let itemValidationIssue = TITLE_MISSING; // CatalogsItemValidationIssue
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.itemsIssues/list(processingResultId, bookmark, pageSize, itemNumbers, itemValidationIssue, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

catalogs:read See all of your catalogs data

Parameters

Path parameters
Name Description
processing_result_id*
String
Unique identifier of a feed processing result. It can be acquired from the "id" field of the "items" array within the response of the [List processing results for a given feed](https://developers.pinterest.com/docs/api/v5/#operation/feed_processing_results/list).
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
item_numbers
array[Integer]
Item number based on order of appearance in the Catalogs Feed. For example, '0' refers to first item found in a feed that was downloaded from a 'location' specified during feed creation.
item_validation_issue
CatalogsItemValidationIssue
Filter item validation issues that have a given type of item validation issue.
ad_account_id
String
Unique identifier of an ad account.

Responses


productsByProductGroupFilter/list

List filtered products

List products Pins owned by the "operation user_account" that meet the criteria specified in the Catalogs Product Group Filter given in the request. - This endpoint has been implemented in POST to allow for complex filters. This specific POST endpoint is designed to be idempotent. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: Owner, Admin, Catalogs Manager. <a href='/docs/shopping/catalog/'>Learn more</a>


/catalogs/products/get_by_product_group_filters

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/catalogs/products/get_by_product_group_filters?bookmark=bookmark_example&page_size=56&ad_account_id=adAccountId_example" \
 -d '{
  "filters" : {
    "any_of" : [ {
      "MIN_PRICE" : {
        "inclusion" : true,
        "negated" : false,
        "values" : 0.08008281904610115
      }
    }, {
      "MIN_PRICE" : {
        "inclusion" : true,
        "negated" : false,
        "values" : 0.08008281904610115
      }
    } ]
  },
  "feed_id" : "2680059592705"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CatalogsApi;

import java.io.File;
import java.util.*;

public class CatalogsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CatalogsApi apiInstance = new CatalogsApi();
        CatalogsListProductsByFilterRequest catalogsListProductsByFilterRequest = ; // CatalogsListProductsByFilterRequest | 
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_group_pins_list_200_response result = apiInstance.productsByProductGroupFilter/list(catalogsListProductsByFilterRequest, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#productsByProductGroupFilter/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final CatalogsListProductsByFilterRequest catalogsListProductsByFilterRequest = new CatalogsListProductsByFilterRequest(); // CatalogsListProductsByFilterRequest | 
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.productsByProductGroupFilter/list(catalogsListProductsByFilterRequest, bookmark, pageSize, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->productsByProductGroupFilter/list: $e\n');
}

import org.openapitools.client.api.CatalogsApi;

public class CatalogsApiExample {
    public static void main(String[] args) {
        CatalogsApi apiInstance = new CatalogsApi();
        CatalogsListProductsByFilterRequest catalogsListProductsByFilterRequest = ; // CatalogsListProductsByFilterRequest | 
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            catalogs_product_group_pins_list_200_response result = apiInstance.productsByProductGroupFilter/list(catalogsListProductsByFilterRequest, bookmark, pageSize, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CatalogsApi#productsByProductGroupFilter/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CatalogsApi *apiInstance = [[CatalogsApi alloc] init];
CatalogsListProductsByFilterRequest *catalogsListProductsByFilterRequest = ; // 
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List filtered products
[apiInstance productsByProductGroupFilter/listWith:catalogsListProductsByFilterRequest
    bookmark:bookmark
    pageSize:pageSize
    adAccountId:adAccountId
              completionHandler: ^(catalogs_product_group_pins_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CatalogsApi()
var catalogsListProductsByFilterRequest = ; // {CatalogsListProductsByFilterRequest} 
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.productsByProductGroupFilter/list(catalogsListProductsByFilterRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class productsByProductGroupFilter/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CatalogsApi();
            var catalogsListProductsByFilterRequest = new CatalogsListProductsByFilterRequest(); // CatalogsListProductsByFilterRequest | 
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List filtered products
                catalogs_product_group_pins_list_200_response result = apiInstance.productsByProductGroupFilter/list(catalogsListProductsByFilterRequest, bookmark, pageSize, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CatalogsApi.productsByProductGroupFilter/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CatalogsApi();
$catalogsListProductsByFilterRequest = ; // CatalogsListProductsByFilterRequest | 
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->productsByProductGroupFilter/list($catalogsListProductsByFilterRequest, $bookmark, $pageSize, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogsApi->productsByProductGroupFilter/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CatalogsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CatalogsApi->new();
my $catalogsListProductsByFilterRequest = WWW::OPenAPIClient::Object::CatalogsListProductsByFilterRequest->new(); # CatalogsListProductsByFilterRequest | 
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->productsByProductGroupFilter/list(catalogsListProductsByFilterRequest => $catalogsListProductsByFilterRequest, bookmark => $bookmark, pageSize => $pageSize, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CatalogsApi->productsByProductGroupFilter/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CatalogsApi()
catalogsListProductsByFilterRequest =  # CatalogsListProductsByFilterRequest | 
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List filtered products
    api_response = api_instance.products_by_product_group_filter/list(catalogsListProductsByFilterRequest, bookmark=bookmark, pageSize=pageSize, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CatalogsApi->productsByProductGroupFilter/list: %s\n" % e)
extern crate CatalogsApi;

pub fn main() {
    let catalogsListProductsByFilterRequest = ; // CatalogsListProductsByFilterRequest
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = CatalogsApi::Context::default();
    let result = client.productsByProductGroupFilter/list(catalogsListProductsByFilterRequest, bookmark, pageSize, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
catalogs:read See all of your catalogs data
pins:read See your public Pins

Parameters

Body parameters
Name Description
catalogsListProductsByFilterRequest *

Object holding a group of filters for a catalog product group

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
ad_account_id
String
Unique identifier of an ad account.

Responses


ConversionEvents

events/create

Send conversions

The Pinterest API offers advertisers a way to send Pinterest their conversion information (including web conversions, in-app conversions, or even offline conversions) based on their <code>ad_account_id</code>. The request body should be a JSON object. - This endpoint requires an <code>access_token</code> be generated through Ads Manager. Review the <a href="/docs/conversions/conversions/">Conversions Guide</a> for more details. - The token's <code>user_account</code> must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Audience, Campaign. (Note that the token can be used across multiple ad accounts under an user ID.) - This endpoint has a rate limit of 5,000 calls per minute per ad account. - If the merchant is submitting this information using both Pinterest conversion tags and the Pinterest API, Pinterest will remove duplicate information before reporting. (Note that events that took place offline cannot be deduplicated.)


/ad_accounts/{ad_account_id}/events

Usage and SDK Samples

curl -X POST \
 \
 -H "Authorization: Bearer [[accessToken]]" \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/events?test=true" \
 -d '{
  "data" : [ {
    "action_source" : "app_ios",
    "wifi" : false,
    "opt_out" : false,
    "app_version" : "7.9",
    "device_model" : "iPhone X",
    "partner_name" : "ss-partnername",
    "os_version" : "12.1.4",
    "device_type" : "iPhone",
    "language" : "en",
    "user_data" : {
      "ct" : [ "4ac01a129bfd10385c9278c2cf2c46fac5ab57350841234f587c8522a2e4ce36" ],
      "st" : [ "49a6d05b8e4b516656e464271d9dd38d0a7e0142f7f49546f4dabd2720cafc34" ],
      "country" : [ "9b202ecbc6d45c6d8901d989a918878397a3eb9d00e8f48022fc051b19d21a1d" ],
      "ln" : [ "7e546b3aa43f989dd359672e6c3409d4f9d4e8f155ae1e9b90ee060985468c19" ],
      "partner_id" : "BUJrTlRRzGJmWhRXFZdkioV6wKPBve7Lom__GU9J74hq2NIQj4O3nOZJrp3mcUr5MptkXsI14juMOIM9mNZnM4zEUFT2JLVaFhcOfuuWz3IWEDtBf6I0DPc",
      "click_id" : "dj0yJnU9b2JDcFFHekV4SHJNcmVrbFBkUEdqakh0akdUT1VjVVUmcD0yJm49cnNBQ3F2Q2dOVDBXWWhkWklrUGxBUSZ0PUFBQUFBR1BaY3Bv",
      "zp" : [ "fd5f56b40a79a385708428e7b32ab996a681080a166a2206e750eb4819186145" ],
      "ph" : [ "45df139772a81b6011bdc1c9cc3d1cb408fc0b10ec0c5cb9d4d4e107f0ddc49d" ],
      "fn" : [ "ec1e6a072231703f1bc41429052fff8c00a7e0c6aaec2e7107241ca8f3ceb6b2" ],
      "external_id" : [ "6a7a73766627eb611720883d5a11cc62b5bfee237b00a6658d78c50032ec4aee" ],
      "ge" : [ "0d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf" ],
      "db" : [ "d4426a0086d10f12ad265539ae8d54221dc67786053d511407204b76e99d7739" ]
    },
    "device_carrier" : "T-Mobile",
    "event_source_url" : "https://www.my-clothing-shop.org/",
    "app_name" : "Pinterest",
    "event_id" : "eventId0001",
    "device_brand" : "Apple",
    "event_name" : "checkout",
    "custom_data" : {
      "content_name" : "pinterest-themed-clothing",
      "content_ids" : [ "red-pinterest-shirt-logo-1", "purple-pinterest-shirt-logo-3" ],
      "np" : "ss-company",
      "content_category" : "shirts",
      "contents" : [ {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      }, {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      } ],
      "num_items" : 2,
      "opt_out_type" : "LDP",
      "content_brand" : "pinterest-brand",
      "currency" : "USD",
      "search_string" : "sample string",
      "value" : "72.39",
      "order_id" : "my_order_id"
    },
    "app_id" : "429047995",
    "event_time" : 1451431341
  }, {
    "action_source" : "app_ios",
    "wifi" : false,
    "opt_out" : false,
    "app_version" : "7.9",
    "device_model" : "iPhone X",
    "partner_name" : "ss-partnername",
    "os_version" : "12.1.4",
    "device_type" : "iPhone",
    "language" : "en",
    "user_data" : {
      "ct" : [ "4ac01a129bfd10385c9278c2cf2c46fac5ab57350841234f587c8522a2e4ce36" ],
      "st" : [ "49a6d05b8e4b516656e464271d9dd38d0a7e0142f7f49546f4dabd2720cafc34" ],
      "country" : [ "9b202ecbc6d45c6d8901d989a918878397a3eb9d00e8f48022fc051b19d21a1d" ],
      "ln" : [ "7e546b3aa43f989dd359672e6c3409d4f9d4e8f155ae1e9b90ee060985468c19" ],
      "partner_id" : "BUJrTlRRzGJmWhRXFZdkioV6wKPBve7Lom__GU9J74hq2NIQj4O3nOZJrp3mcUr5MptkXsI14juMOIM9mNZnM4zEUFT2JLVaFhcOfuuWz3IWEDtBf6I0DPc",
      "click_id" : "dj0yJnU9b2JDcFFHekV4SHJNcmVrbFBkUEdqakh0akdUT1VjVVUmcD0yJm49cnNBQ3F2Q2dOVDBXWWhkWklrUGxBUSZ0PUFBQUFBR1BaY3Bv",
      "zp" : [ "fd5f56b40a79a385708428e7b32ab996a681080a166a2206e750eb4819186145" ],
      "ph" : [ "45df139772a81b6011bdc1c9cc3d1cb408fc0b10ec0c5cb9d4d4e107f0ddc49d" ],
      "fn" : [ "ec1e6a072231703f1bc41429052fff8c00a7e0c6aaec2e7107241ca8f3ceb6b2" ],
      "external_id" : [ "6a7a73766627eb611720883d5a11cc62b5bfee237b00a6658d78c50032ec4aee" ],
      "ge" : [ "0d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf" ],
      "db" : [ "d4426a0086d10f12ad265539ae8d54221dc67786053d511407204b76e99d7739" ]
    },
    "device_carrier" : "T-Mobile",
    "event_source_url" : "https://www.my-clothing-shop.org/",
    "app_name" : "Pinterest",
    "event_id" : "eventId0001",
    "device_brand" : "Apple",
    "event_name" : "checkout",
    "custom_data" : {
      "content_name" : "pinterest-themed-clothing",
      "content_ids" : [ "red-pinterest-shirt-logo-1", "purple-pinterest-shirt-logo-3" ],
      "np" : "ss-company",
      "content_category" : "shirts",
      "contents" : [ {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      }, {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      } ],
      "num_items" : 2,
      "opt_out_type" : "LDP",
      "content_brand" : "pinterest-brand",
      "currency" : "USD",
      "search_string" : "sample string",
      "value" : "72.39",
      "order_id" : "my_order_id"
    },
    "app_id" : "429047995",
    "event_time" : 1451431341
  }, {
    "action_source" : "app_ios",
    "wifi" : false,
    "opt_out" : false,
    "app_version" : "7.9",
    "device_model" : "iPhone X",
    "partner_name" : "ss-partnername",
    "os_version" : "12.1.4",
    "device_type" : "iPhone",
    "language" : "en",
    "user_data" : {
      "ct" : [ "4ac01a129bfd10385c9278c2cf2c46fac5ab57350841234f587c8522a2e4ce36" ],
      "st" : [ "49a6d05b8e4b516656e464271d9dd38d0a7e0142f7f49546f4dabd2720cafc34" ],
      "country" : [ "9b202ecbc6d45c6d8901d989a918878397a3eb9d00e8f48022fc051b19d21a1d" ],
      "ln" : [ "7e546b3aa43f989dd359672e6c3409d4f9d4e8f155ae1e9b90ee060985468c19" ],
      "partner_id" : "BUJrTlRRzGJmWhRXFZdkioV6wKPBve7Lom__GU9J74hq2NIQj4O3nOZJrp3mcUr5MptkXsI14juMOIM9mNZnM4zEUFT2JLVaFhcOfuuWz3IWEDtBf6I0DPc",
      "click_id" : "dj0yJnU9b2JDcFFHekV4SHJNcmVrbFBkUEdqakh0akdUT1VjVVUmcD0yJm49cnNBQ3F2Q2dOVDBXWWhkWklrUGxBUSZ0PUFBQUFBR1BaY3Bv",
      "zp" : [ "fd5f56b40a79a385708428e7b32ab996a681080a166a2206e750eb4819186145" ],
      "ph" : [ "45df139772a81b6011bdc1c9cc3d1cb408fc0b10ec0c5cb9d4d4e107f0ddc49d" ],
      "fn" : [ "ec1e6a072231703f1bc41429052fff8c00a7e0c6aaec2e7107241ca8f3ceb6b2" ],
      "external_id" : [ "6a7a73766627eb611720883d5a11cc62b5bfee237b00a6658d78c50032ec4aee" ],
      "ge" : [ "0d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf" ],
      "db" : [ "d4426a0086d10f12ad265539ae8d54221dc67786053d511407204b76e99d7739" ]
    },
    "device_carrier" : "T-Mobile",
    "event_source_url" : "https://www.my-clothing-shop.org/",
    "app_name" : "Pinterest",
    "event_id" : "eventId0001",
    "device_brand" : "Apple",
    "event_name" : "checkout",
    "custom_data" : {
      "content_name" : "pinterest-themed-clothing",
      "content_ids" : [ "red-pinterest-shirt-logo-1", "purple-pinterest-shirt-logo-3" ],
      "np" : "ss-company",
      "content_category" : "shirts",
      "contents" : [ {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      }, {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      } ],
      "num_items" : 2,
      "opt_out_type" : "LDP",
      "content_brand" : "pinterest-brand",
      "currency" : "USD",
      "search_string" : "sample string",
      "value" : "72.39",
      "order_id" : "my_order_id"
    },
    "app_id" : "429047995",
    "event_time" : 1451431341
  }, {
    "action_source" : "app_ios",
    "wifi" : false,
    "opt_out" : false,
    "app_version" : "7.9",
    "device_model" : "iPhone X",
    "partner_name" : "ss-partnername",
    "os_version" : "12.1.4",
    "device_type" : "iPhone",
    "language" : "en",
    "user_data" : {
      "ct" : [ "4ac01a129bfd10385c9278c2cf2c46fac5ab57350841234f587c8522a2e4ce36" ],
      "st" : [ "49a6d05b8e4b516656e464271d9dd38d0a7e0142f7f49546f4dabd2720cafc34" ],
      "country" : [ "9b202ecbc6d45c6d8901d989a918878397a3eb9d00e8f48022fc051b19d21a1d" ],
      "ln" : [ "7e546b3aa43f989dd359672e6c3409d4f9d4e8f155ae1e9b90ee060985468c19" ],
      "partner_id" : "BUJrTlRRzGJmWhRXFZdkioV6wKPBve7Lom__GU9J74hq2NIQj4O3nOZJrp3mcUr5MptkXsI14juMOIM9mNZnM4zEUFT2JLVaFhcOfuuWz3IWEDtBf6I0DPc",
      "click_id" : "dj0yJnU9b2JDcFFHekV4SHJNcmVrbFBkUEdqakh0akdUT1VjVVUmcD0yJm49cnNBQ3F2Q2dOVDBXWWhkWklrUGxBUSZ0PUFBQUFBR1BaY3Bv",
      "zp" : [ "fd5f56b40a79a385708428e7b32ab996a681080a166a2206e750eb4819186145" ],
      "ph" : [ "45df139772a81b6011bdc1c9cc3d1cb408fc0b10ec0c5cb9d4d4e107f0ddc49d" ],
      "fn" : [ "ec1e6a072231703f1bc41429052fff8c00a7e0c6aaec2e7107241ca8f3ceb6b2" ],
      "external_id" : [ "6a7a73766627eb611720883d5a11cc62b5bfee237b00a6658d78c50032ec4aee" ],
      "ge" : [ "0d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf" ],
      "db" : [ "d4426a0086d10f12ad265539ae8d54221dc67786053d511407204b76e99d7739" ]
    },
    "device_carrier" : "T-Mobile",
    "event_source_url" : "https://www.my-clothing-shop.org/",
    "app_name" : "Pinterest",
    "event_id" : "eventId0001",
    "device_brand" : "Apple",
    "event_name" : "checkout",
    "custom_data" : {
      "content_name" : "pinterest-themed-clothing",
      "content_ids" : [ "red-pinterest-shirt-logo-1", "purple-pinterest-shirt-logo-3" ],
      "np" : "ss-company",
      "content_category" : "shirts",
      "contents" : [ {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      }, {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      } ],
      "num_items" : 2,
      "opt_out_type" : "LDP",
      "content_brand" : "pinterest-brand",
      "currency" : "USD",
      "search_string" : "sample string",
      "value" : "72.39",
      "order_id" : "my_order_id"
    },
    "app_id" : "429047995",
    "event_time" : 1451431341
  }, {
    "action_source" : "app_ios",
    "wifi" : false,
    "opt_out" : false,
    "app_version" : "7.9",
    "device_model" : "iPhone X",
    "partner_name" : "ss-partnername",
    "os_version" : "12.1.4",
    "device_type" : "iPhone",
    "language" : "en",
    "user_data" : {
      "ct" : [ "4ac01a129bfd10385c9278c2cf2c46fac5ab57350841234f587c8522a2e4ce36" ],
      "st" : [ "49a6d05b8e4b516656e464271d9dd38d0a7e0142f7f49546f4dabd2720cafc34" ],
      "country" : [ "9b202ecbc6d45c6d8901d989a918878397a3eb9d00e8f48022fc051b19d21a1d" ],
      "ln" : [ "7e546b3aa43f989dd359672e6c3409d4f9d4e8f155ae1e9b90ee060985468c19" ],
      "partner_id" : "BUJrTlRRzGJmWhRXFZdkioV6wKPBve7Lom__GU9J74hq2NIQj4O3nOZJrp3mcUr5MptkXsI14juMOIM9mNZnM4zEUFT2JLVaFhcOfuuWz3IWEDtBf6I0DPc",
      "click_id" : "dj0yJnU9b2JDcFFHekV4SHJNcmVrbFBkUEdqakh0akdUT1VjVVUmcD0yJm49cnNBQ3F2Q2dOVDBXWWhkWklrUGxBUSZ0PUFBQUFBR1BaY3Bv",
      "zp" : [ "fd5f56b40a79a385708428e7b32ab996a681080a166a2206e750eb4819186145" ],
      "ph" : [ "45df139772a81b6011bdc1c9cc3d1cb408fc0b10ec0c5cb9d4d4e107f0ddc49d" ],
      "fn" : [ "ec1e6a072231703f1bc41429052fff8c00a7e0c6aaec2e7107241ca8f3ceb6b2" ],
      "external_id" : [ "6a7a73766627eb611720883d5a11cc62b5bfee237b00a6658d78c50032ec4aee" ],
      "ge" : [ "0d248e82c62c9386878327d491c762a002152d42ab2c391a31c44d9f62675ddf" ],
      "db" : [ "d4426a0086d10f12ad265539ae8d54221dc67786053d511407204b76e99d7739" ]
    },
    "device_carrier" : "T-Mobile",
    "event_source_url" : "https://www.my-clothing-shop.org/",
    "app_name" : "Pinterest",
    "event_id" : "eventId0001",
    "device_brand" : "Apple",
    "event_name" : "checkout",
    "custom_data" : {
      "content_name" : "pinterest-themed-clothing",
      "content_ids" : [ "red-pinterest-shirt-logo-1", "purple-pinterest-shirt-logo-3" ],
      "np" : "ss-company",
      "content_category" : "shirts",
      "contents" : [ {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      }, {
        "quantity" : 5,
        "item_price" : "1325.12",
        "item_name" : "pinterest-clothing-shirt",
        "id" : "red-pinterest-shirt-logo-1",
        "item_brand" : "pinterest",
        "item_category" : "pinterest-entertainment"
      } ],
      "num_items" : 2,
      "opt_out_type" : "LDP",
      "content_brand" : "pinterest-brand",
      "currency" : "USD",
      "search_string" : "sample string",
      "value" : "72.39",
      "order_id" : "my_order_id"
    },
    "app_id" : "429047995",
    "event_time" : 1451431341
  } ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ConversionEventsApi;

import java.io.File;
import java.util.*;

public class ConversionEventsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Configure Bearer access token for authorization: conversion_token
        HttpBearerAuth conversion_token = (HttpBearerAuth) defaultClient.getAuthentication("conversion_token");
        conversion_token.setBearerToken("BEARER TOKEN");

        // Create an instance of the API class
        ConversionEventsApi apiInstance = new ConversionEventsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ConversionEvents conversionEvents = ; // ConversionEvents | 
        Boolean test = true; // Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.

        try {
            ConversionApiResponse result = apiInstance.events/create(adAccountId, conversionEvents, test);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionEventsApi#events/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final ConversionEvents conversionEvents = new ConversionEvents(); // ConversionEvents | 
final Boolean test = new Boolean(); // Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.

try {
    final result = await api_instance.events/create(adAccountId, conversionEvents, test);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->events/create: $e\n');
}

import org.openapitools.client.api.ConversionEventsApi;

public class ConversionEventsApiExample {
    public static void main(String[] args) {
        ConversionEventsApi apiInstance = new ConversionEventsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ConversionEvents conversionEvents = ; // ConversionEvents | 
        Boolean test = true; // Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.

        try {
            ConversionApiResponse result = apiInstance.events/create(adAccountId, conversionEvents, test);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionEventsApi#events/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

// Configure Bearer access token for authorization: conversion_token
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

// Create an instance of the API class
ConversionEventsApi *apiInstance = [[ConversionEventsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
ConversionEvents *conversionEvents = ; // 
Boolean *test = true; // Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request. (optional) (default to null)

// Send conversions
[apiInstance events/createWith:adAccountId
    conversionEvents:conversionEvents
    test:test
              completionHandler: ^(ConversionApiResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Configure Bearer access token for authorization: conversion_token
var conversion_token = defaultClient.authentications['conversion_token'];
conversion_token.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ConversionEventsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var conversionEvents = ; // {ConversionEvents} 
var opts = {
  'test': true // {Boolean} Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.events/create(adAccountId, conversionEvents, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class events/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
            // Configure Bearer access token for authorization: conversion_token
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ConversionEventsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var conversionEvents = new ConversionEvents(); // ConversionEvents | 
            var test = true;  // Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request. (optional)  (default to null)

            try {
                // Send conversions
                ConversionApiResponse result = apiInstance.events/create(adAccountId, conversionEvents, test);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ConversionEventsApi.events/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure Bearer access token for authorization: conversion_token
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ConversionEventsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$conversionEvents = ; // ConversionEvents | 
$test = true; // Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.

try {
    $result = $api_instance->events/create($adAccountId, $conversionEvents, $test);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionEventsApi->events/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ConversionEventsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Configure Bearer access token for authorization: conversion_token
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ConversionEventsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $conversionEvents = WWW::OPenAPIClient::Object::ConversionEvents->new(); # ConversionEvents | 
my $test = true; # Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.

eval {
    my $result = $api_instance->events/create(adAccountId => $adAccountId, conversionEvents => $conversionEvents, test => $test);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConversionEventsApi->events/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Configure Bearer access token for authorization: conversion_token
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ConversionEventsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
conversionEvents =  # ConversionEvents | 
test = true # Boolean | Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly.
Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request. (optional) (default to null)

try:
    # Send conversions
    api_response = api_instance.events/create(adAccountId, conversionEvents, test=test)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversionEventsApi->events/create: %s\n" % e)
extern crate ConversionEventsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let conversionEvents = ; // ConversionEvents
    let test = true; // Boolean

    let mut context = ConversionEventsApi::Context::default();
    let result = client.events/create(adAccountId, conversionEvents, test, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
conversionEvents *

Conversion events.

Query parameters
Name Description
test
Boolean
Include query param ?test=true to mark the request as a test request. The events will not be recorded but the API will still return the same response messages. Use this mode to verify your requests are working and your events are constructed correctly. Warning: If you use this query parameter, be certain that it is off (set to false or deleted) before sending a legitimate (non-testing) request.

Responses


ConversionTags

conversionTags/create

Create conversion tag

Create a conversion tag, also known as <a href="https://help.pinterest.com/en/business/article/set-up-the-pinterest-tag" target="_blank">Pinterest tag</a>, with the option to enable enhanced match.<p/> The Pinterest Tag tracks actions people take on the ad account’s website after they view the ad account's ad on Pinterest. The advertiser needs to customize this tag to track conversions.<p/> For more information, see:<p/> <a class="reference external" href="https://help.pinterest.com/en/business/article/set-up-the-pinterest-tag">Set up the Pinterest tag</a><p/> <a class="reference external" href="https://developers.pinterest.com/docs/conversions/pinterest-tag/">Pinterest Tag</a><p/> <a class="reference external" href="https://developers.pinterest.com/docs/conversions/enhanced-match/">Enhanced match</a>


/ad_accounts/{ad_account_id}/conversion_tags

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/conversion_tags" \
 -d '{
  "name" : "ACME Tools Tag"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ConversionTagsApi;

import java.io.File;
import java.util.*;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ConversionTagCreate conversionTagCreate = ; // ConversionTagCreate | 

        try {
            ConversionTagResponse result = apiInstance.conversionTags/create(adAccountId, conversionTagCreate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#conversionTags/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final ConversionTagCreate conversionTagCreate = new ConversionTagCreate(); // ConversionTagCreate | 

try {
    final result = await api_instance.conversionTags/create(adAccountId, conversionTagCreate);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->conversionTags/create: $e\n');
}

import org.openapitools.client.api.ConversionTagsApi;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ConversionTagCreate conversionTagCreate = ; // ConversionTagCreate | 

        try {
            ConversionTagResponse result = apiInstance.conversionTags/create(adAccountId, conversionTagCreate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#conversionTags/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ConversionTagsApi *apiInstance = [[ConversionTagsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
ConversionTagCreate *conversionTagCreate = ; // 

// Create conversion tag
[apiInstance conversionTags/createWith:adAccountId
    conversionTagCreate:conversionTagCreate
              completionHandler: ^(ConversionTagResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ConversionTagsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var conversionTagCreate = ; // {ConversionTagCreate} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.conversionTags/create(adAccountId, conversionTagCreate, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class conversionTags/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ConversionTagsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var conversionTagCreate = new ConversionTagCreate(); // ConversionTagCreate | 

            try {
                // Create conversion tag
                ConversionTagResponse result = apiInstance.conversionTags/create(adAccountId, conversionTagCreate);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ConversionTagsApi.conversionTags/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ConversionTagsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$conversionTagCreate = ; // ConversionTagCreate | 

try {
    $result = $api_instance->conversionTags/create($adAccountId, $conversionTagCreate);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionTagsApi->conversionTags/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ConversionTagsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ConversionTagsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $conversionTagCreate = WWW::OPenAPIClient::Object::ConversionTagCreate->new(); # ConversionTagCreate | 

eval {
    my $result = $api_instance->conversionTags/create(adAccountId => $adAccountId, conversionTagCreate => $conversionTagCreate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConversionTagsApi->conversionTags/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ConversionTagsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
conversionTagCreate =  # ConversionTagCreate | 

try:
    # Create conversion tag
    api_response = api_instance.conversion_tags/create(adAccountId, conversionTagCreate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversionTagsApi->conversionTags/create: %s\n" % e)
extern crate ConversionTagsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let conversionTagCreate = ; // ConversionTagCreate

    let mut context = ConversionTagsApi::Context::default();
    let result = client.conversionTags/create(adAccountId, conversionTagCreate, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
conversionTagCreate *

Conversion Tag to create

Responses


conversionTags/get

Get conversion tag

Get information about an existing conversion tag.


/ad_accounts/{ad_account_id}/conversion_tags/{conversion_tag_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/conversion_tags/{conversion_tag_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ConversionTagsApi;

import java.io.File;
import java.util.*;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String conversionTagId = 2617998078212; // String | Id of the conversion tag.

        try {
            ConversionTagResponse result = apiInstance.conversionTags/get(adAccountId, conversionTagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#conversionTags/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String conversionTagId = new String(); // String | Id of the conversion tag.

try {
    final result = await api_instance.conversionTags/get(adAccountId, conversionTagId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->conversionTags/get: $e\n');
}

import org.openapitools.client.api.ConversionTagsApi;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String conversionTagId = 2617998078212; // String | Id of the conversion tag.

        try {
            ConversionTagResponse result = apiInstance.conversionTags/get(adAccountId, conversionTagId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#conversionTags/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ConversionTagsApi *apiInstance = [[ConversionTagsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *conversionTagId = 2617998078212; // Id of the conversion tag. (default to null)

// Get conversion tag
[apiInstance conversionTags/getWith:adAccountId
    conversionTagId:conversionTagId
              completionHandler: ^(ConversionTagResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ConversionTagsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var conversionTagId = 2617998078212; // {String} Id of the conversion tag.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.conversionTags/get(adAccountId, conversionTagId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class conversionTags/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ConversionTagsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var conversionTagId = 2617998078212;  // String | Id of the conversion tag. (default to null)

            try {
                // Get conversion tag
                ConversionTagResponse result = apiInstance.conversionTags/get(adAccountId, conversionTagId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ConversionTagsApi.conversionTags/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ConversionTagsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$conversionTagId = 2617998078212; // String | Id of the conversion tag.

try {
    $result = $api_instance->conversionTags/get($adAccountId, $conversionTagId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionTagsApi->conversionTags/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ConversionTagsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ConversionTagsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $conversionTagId = 2617998078212; # String | Id of the conversion tag.

eval {
    my $result = $api_instance->conversionTags/get(adAccountId => $adAccountId, conversionTagId => $conversionTagId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConversionTagsApi->conversionTags/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ConversionTagsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
conversionTagId = 2617998078212 # String | Id of the conversion tag. (default to null)

try:
    # Get conversion tag
    api_response = api_instance.conversion_tags/get(adAccountId, conversionTagId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversionTagsApi->conversionTags/get: %s\n" % e)
extern crate ConversionTagsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let conversionTagId = 2617998078212; // String

    let mut context = ConversionTagsApi::Context::default();
    let result = client.conversionTags/get(adAccountId, conversionTagId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
conversion_tag_id*
String
Id of the conversion tag.
Required

Responses


conversionTags/list

Get conversion tags

List conversion tags associated with an ad account.


/ad_accounts/{ad_account_id}/conversion_tags

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/conversion_tags?filter_deleted=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ConversionTagsApi;

import java.io.File;
import java.util.*;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Boolean filterDeleted = true; // Boolean | Filter out deleted tags.

        try {
            ConversionTagListResponse result = apiInstance.conversionTags/list(adAccountId, filterDeleted);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#conversionTags/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Boolean filterDeleted = new Boolean(); // Boolean | Filter out deleted tags.

try {
    final result = await api_instance.conversionTags/list(adAccountId, filterDeleted);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->conversionTags/list: $e\n');
}

import org.openapitools.client.api.ConversionTagsApi;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Boolean filterDeleted = true; // Boolean | Filter out deleted tags.

        try {
            ConversionTagListResponse result = apiInstance.conversionTags/list(adAccountId, filterDeleted);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#conversionTags/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ConversionTagsApi *apiInstance = [[ConversionTagsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Boolean *filterDeleted = true; // Filter out deleted tags. (optional) (default to false)

// Get conversion tags
[apiInstance conversionTags/listWith:adAccountId
    filterDeleted:filterDeleted
              completionHandler: ^(ConversionTagListResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ConversionTagsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'filterDeleted': true // {Boolean} Filter out deleted tags.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.conversionTags/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class conversionTags/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ConversionTagsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var filterDeleted = true;  // Boolean | Filter out deleted tags. (optional)  (default to false)

            try {
                // Get conversion tags
                ConversionTagListResponse result = apiInstance.conversionTags/list(adAccountId, filterDeleted);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ConversionTagsApi.conversionTags/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ConversionTagsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$filterDeleted = true; // Boolean | Filter out deleted tags.

try {
    $result = $api_instance->conversionTags/list($adAccountId, $filterDeleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionTagsApi->conversionTags/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ConversionTagsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ConversionTagsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $filterDeleted = true; # Boolean | Filter out deleted tags.

eval {
    my $result = $api_instance->conversionTags/list(adAccountId => $adAccountId, filterDeleted => $filterDeleted);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConversionTagsApi->conversionTags/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ConversionTagsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
filterDeleted = true # Boolean | Filter out deleted tags. (optional) (default to false)

try:
    # Get conversion tags
    api_response = api_instance.conversion_tags/list(adAccountId, filterDeleted=filterDeleted)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversionTagsApi->conversionTags/list: %s\n" % e)
extern crate ConversionTagsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let filterDeleted = true; // Boolean

    let mut context = ConversionTagsApi::Context::default();
    let result = client.conversionTags/list(adAccountId, filterDeleted, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
filter_deleted
Boolean
Filter out deleted tags.

Responses


ocpmEligibleConversionTags/get

Get Ocpm eligible conversion tags

Get Ocpm eligible conversion tag events for an ad account.


/ad_accounts/{ad_account_id}/conversion_tags/ocpm_eligible

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/conversion_tags/ocpm_eligible"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ConversionTagsApi;

import java.io.File;
import java.util.*;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            map['String', array[ConversionEventResponse]] result = apiInstance.ocpmEligibleConversionTags/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#ocpmEligibleConversionTags/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.ocpmEligibleConversionTags/get(adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->ocpmEligibleConversionTags/get: $e\n');
}

import org.openapitools.client.api.ConversionTagsApi;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            map['String', array[ConversionEventResponse]] result = apiInstance.ocpmEligibleConversionTags/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#ocpmEligibleConversionTags/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ConversionTagsApi *apiInstance = [[ConversionTagsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)

// Get Ocpm eligible conversion tags
[apiInstance ocpmEligibleConversionTags/getWith:adAccountId
              completionHandler: ^(map['String', array[ConversionEventResponse]] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ConversionTagsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.ocpmEligibleConversionTags/get(adAccountId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ocpmEligibleConversionTags/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ConversionTagsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)

            try {
                // Get Ocpm eligible conversion tags
                map['String', array[ConversionEventResponse]] result = apiInstance.ocpmEligibleConversionTags/get(adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ConversionTagsApi.ocpmEligibleConversionTags/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ConversionTagsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->ocpmEligibleConversionTags/get($adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionTagsApi->ocpmEligibleConversionTags/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ConversionTagsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ConversionTagsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->ocpmEligibleConversionTags/get(adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConversionTagsApi->ocpmEligibleConversionTags/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ConversionTagsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)

try:
    # Get Ocpm eligible conversion tags
    api_response = api_instance.ocpm_eligible_conversion_tags/get(adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversionTagsApi->ocpmEligibleConversionTags/get: %s\n" % e)
extern crate ConversionTagsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String

    let mut context = ConversionTagsApi::Context::default();
    let result = client.ocpmEligibleConversionTags/get(adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required

Responses


pageVisitConversionTags/get

Get page visit conversion tags

Get all page visit conversion tag events for an ad account.


/ad_accounts/{ad_account_id}/conversion_tags/page_visit

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/conversion_tags/page_visit?page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ConversionTagsApi;

import java.io.File;
import java.util.*;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            page_visit_conversion_tags_get_200_response result = apiInstance.pageVisitConversionTags/get(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#pageVisitConversionTags/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.pageVisitConversionTags/get(adAccountId, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pageVisitConversionTags/get: $e\n');
}

import org.openapitools.client.api.ConversionTagsApi;

public class ConversionTagsApiExample {
    public static void main(String[] args) {
        ConversionTagsApi apiInstance = new ConversionTagsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            page_visit_conversion_tags_get_200_response result = apiInstance.pageVisitConversionTags/get(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConversionTagsApi#pageVisitConversionTags/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ConversionTagsApi *apiInstance = [[ConversionTagsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get page visit conversion tags
[apiInstance pageVisitConversionTags/getWith:adAccountId
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(page_visit_conversion_tags_get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ConversionTagsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.pageVisitConversionTags/get(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pageVisitConversionTags/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ConversionTagsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get page visit conversion tags
                page_visit_conversion_tags_get_200_response result = apiInstance.pageVisitConversionTags/get(adAccountId, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ConversionTagsApi.pageVisitConversionTags/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ConversionTagsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->pageVisitConversionTags/get($adAccountId, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionTagsApi->pageVisitConversionTags/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ConversionTagsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ConversionTagsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->pageVisitConversionTags/get(adAccountId => $adAccountId, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConversionTagsApi->pageVisitConversionTags/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ConversionTagsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get page visit conversion tags
    api_response = api_instance.page_visit_conversion_tags/get(adAccountId, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConversionTagsApi->pageVisitConversionTags/get: %s\n" % e)
extern crate ConversionTagsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = ConversionTagsApi::Context::default();
    let result = client.pageVisitConversionTags/get(adAccountId, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


CustomerLists

customerLists/create

Create customer lists

<p>Create a customer list from your records(hashed or plain-text email addresses, or hashed MAIDs or IDFAs).</p> <p>A customer list is one of the four types of Pinterest audiences: for more information, see <a href="https://help.pinterest.com/en/business/article/audience-targeting" target="_blank">Audience targeting</a> or the <a href="/docs/ads/targeting/#Audiences" target="_blank">Audiences</a> section of the ads management guide.<p/> <p><b>Please review our <u><a href="https://help.pinterest.com/en/business/article/audience-targeting#section-13341" target="_blank">requirements</a></u> for what type of information is allowed when uploading a customer list.</b></p> <p>When you create a customer list, the system scans the list for existing Pinterest accounts; the list must include at least 100 Pinterest accounts. Your original list will be deleted when the matching process is complete. The filtered list – containing only the Pinterest accounts that were included in your starting list – is what will be used to create the audience.</p> <p>Note that once you have created your customer list, you must convert it into an audience (of the “CUSTOMER_LIST” type) using the <a href="#operation/create_audience_handler">create audience endpoint</a> before it can be used.</p>


/ad_accounts/{ad_account_id}/customer_lists

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/customer_lists" \
 -d '{
  "list_type" : "EMAIL",
  "records" : "email1@pinterest.com,email2@pinterest.com,..<more records>",
  "name" : "The Glengarry Glen Ross leads",
  "exceptions" : "{}"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CustomerListsApi;

import java.io.File;
import java.util.*;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        CustomerListRequest customerListRequest = ; // CustomerListRequest | 

        try {
            CustomerList result = apiInstance.customerLists/create(adAccountId, customerListRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final CustomerListRequest customerListRequest = new CustomerListRequest(); // CustomerListRequest | 

try {
    final result = await api_instance.customerLists/create(adAccountId, customerListRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->customerLists/create: $e\n');
}

import org.openapitools.client.api.CustomerListsApi;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        CustomerListRequest customerListRequest = ; // CustomerListRequest | 

        try {
            CustomerList result = apiInstance.customerLists/create(adAccountId, customerListRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CustomerListsApi *apiInstance = [[CustomerListsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
CustomerListRequest *customerListRequest = ; // 

// Create customer lists
[apiInstance customerLists/createWith:adAccountId
    customerListRequest:customerListRequest
              completionHandler: ^(CustomerList output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CustomerListsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var customerListRequest = ; // {CustomerListRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.customerLists/create(adAccountId, customerListRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class customerLists/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CustomerListsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var customerListRequest = new CustomerListRequest(); // CustomerListRequest | 

            try {
                // Create customer lists
                CustomerList result = apiInstance.customerLists/create(adAccountId, customerListRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CustomerListsApi.customerLists/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CustomerListsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$customerListRequest = ; // CustomerListRequest | 

try {
    $result = $api_instance->customerLists/create($adAccountId, $customerListRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerListsApi->customerLists/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CustomerListsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CustomerListsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $customerListRequest = WWW::OPenAPIClient::Object::CustomerListRequest->new(); # CustomerListRequest | 

eval {
    my $result = $api_instance->customerLists/create(adAccountId => $adAccountId, customerListRequest => $customerListRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CustomerListsApi->customerLists/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CustomerListsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
customerListRequest =  # CustomerListRequest | 

try:
    # Create customer lists
    api_response = api_instance.customer_lists/create(adAccountId, customerListRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomerListsApi->customerLists/create: %s\n" % e)
extern crate CustomerListsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let customerListRequest = ; // CustomerListRequest

    let mut context = CustomerListsApi::Context::default();
    let result = client.customerLists/create(adAccountId, customerListRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
customerListRequest *

Parameters to get Customer lists info

Responses


customerLists/get

Get customer list

Gets a specific customer list given the customer list ID.


/ad_accounts/{ad_account_id}/customer_lists/{customer_list_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/customer_lists/{customer_list_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CustomerListsApi;

import java.io.File;
import java.util.*;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String customerListId = customerListId_example; // String | Unique identifier of a customer list

        try {
            CustomerList result = apiInstance.customerLists/get(adAccountId, customerListId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String customerListId = new String(); // String | Unique identifier of a customer list

try {
    final result = await api_instance.customerLists/get(adAccountId, customerListId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->customerLists/get: $e\n');
}

import org.openapitools.client.api.CustomerListsApi;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String customerListId = customerListId_example; // String | Unique identifier of a customer list

        try {
            CustomerList result = apiInstance.customerLists/get(adAccountId, customerListId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CustomerListsApi *apiInstance = [[CustomerListsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *customerListId = customerListId_example; // Unique identifier of a customer list (default to null)

// Get customer list
[apiInstance customerLists/getWith:adAccountId
    customerListId:customerListId
              completionHandler: ^(CustomerList output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CustomerListsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var customerListId = customerListId_example; // {String} Unique identifier of a customer list

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.customerLists/get(adAccountId, customerListId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class customerLists/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CustomerListsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var customerListId = customerListId_example;  // String | Unique identifier of a customer list (default to null)

            try {
                // Get customer list
                CustomerList result = apiInstance.customerLists/get(adAccountId, customerListId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CustomerListsApi.customerLists/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CustomerListsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$customerListId = customerListId_example; // String | Unique identifier of a customer list

try {
    $result = $api_instance->customerLists/get($adAccountId, $customerListId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerListsApi->customerLists/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CustomerListsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CustomerListsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $customerListId = customerListId_example; # String | Unique identifier of a customer list

eval {
    my $result = $api_instance->customerLists/get(adAccountId => $adAccountId, customerListId => $customerListId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CustomerListsApi->customerLists/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CustomerListsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
customerListId = customerListId_example # String | Unique identifier of a customer list (default to null)

try:
    # Get customer list
    api_response = api_instance.customer_lists/get(adAccountId, customerListId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomerListsApi->customerLists/get: %s\n" % e)
extern crate CustomerListsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let customerListId = customerListId_example; // String

    let mut context = CustomerListsApi::Context::default();
    let result = client.customerLists/get(adAccountId, customerListId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
customer_list_id*
String
Unique identifier of a customer list
Required

Responses


customerLists/list

Get customer lists

<p>Get a set of customer lists including id and name based on the filters provided.</p> <p>(Customer lists are a type of audience.) For more information, see <a href="https://help.pinterest.com/en/business/article/audience-targeting" target="_blank">Audience targeting</a> or the <a href="/docs/ads/targeting/#Audiences" target="_blank">Audiences</a> section of the ads management guide.</p>


/ad_accounts/{ad_account_id}/customer_lists

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/customer_lists?page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CustomerListsApi;

import java.io.File;
import java.util.*;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            customer_lists_list_200_response result = apiInstance.customerLists/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.customerLists/list(adAccountId, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->customerLists/list: $e\n');
}

import org.openapitools.client.api.CustomerListsApi;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            customer_lists_list_200_response result = apiInstance.customerLists/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CustomerListsApi *apiInstance = [[CustomerListsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get customer lists
[apiInstance customerLists/listWith:adAccountId
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(customer_lists_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CustomerListsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.customerLists/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class customerLists/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CustomerListsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get customer lists
                customer_lists_list_200_response result = apiInstance.customerLists/list(adAccountId, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CustomerListsApi.customerLists/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CustomerListsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->customerLists/list($adAccountId, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerListsApi->customerLists/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CustomerListsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CustomerListsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->customerLists/list(adAccountId => $adAccountId, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CustomerListsApi->customerLists/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CustomerListsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get customer lists
    api_response = api_instance.customer_lists/list(adAccountId, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomerListsApi->customerLists/list: %s\n" % e)
extern crate CustomerListsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = CustomerListsApi::Context::default();
    let result = client.customerLists/list(adAccountId, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


customerLists/update

Update customer list

<p>Append or remove records to/from an existing customer list. (A customer list is one of the four types of Pinterest audiences.)</p> <p>When you add records to an existing customer list, the system scans the additions for existing Pinterest accounts; those are the records that will be added to your “CUSTOMER_LIST” audience. Your original list of records to add will be deleted when the matching process is complete.</p> <p>For more information, see <a href="https://help.pinterest.com/en/business/article/audience-targeting" target="_blank">Audience targeting</a> or the <a href="/docs/ads/targeting/#Audiences" target="_blank">Audiences</a> section of the ads management guide.</p>


/ad_accounts/{ad_account_id}/customer_lists/{customer_list_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/customer_lists/{customer_list_id}" \
 -d '{
  "operation_type" : "operation_type",
  "records" : "email2@pinterest.com,email6@pinterest.com,",
  "exceptions" : {
    "code" : 2,
    "message" : "Advertiser not found."
  }
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.CustomerListsApi;

import java.io.File;
import java.util.*;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String customerListId = customerListId_example; // String | Unique identifier of a customer list
        CustomerListUpdateRequest customerListUpdateRequest = ; // CustomerListUpdateRequest | 

        try {
            CustomerList result = apiInstance.customerLists/update(adAccountId, customerListId, customerListUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String customerListId = new String(); // String | Unique identifier of a customer list
final CustomerListUpdateRequest customerListUpdateRequest = new CustomerListUpdateRequest(); // CustomerListUpdateRequest | 

try {
    final result = await api_instance.customerLists/update(adAccountId, customerListId, customerListUpdateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->customerLists/update: $e\n');
}

import org.openapitools.client.api.CustomerListsApi;

public class CustomerListsApiExample {
    public static void main(String[] args) {
        CustomerListsApi apiInstance = new CustomerListsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String customerListId = customerListId_example; // String | Unique identifier of a customer list
        CustomerListUpdateRequest customerListUpdateRequest = ; // CustomerListUpdateRequest | 

        try {
            CustomerList result = apiInstance.customerLists/update(adAccountId, customerListId, customerListUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CustomerListsApi#customerLists/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
CustomerListsApi *apiInstance = [[CustomerListsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *customerListId = customerListId_example; // Unique identifier of a customer list (default to null)
CustomerListUpdateRequest *customerListUpdateRequest = ; // 

// Update customer list
[apiInstance customerLists/updateWith:adAccountId
    customerListId:customerListId
    customerListUpdateRequest:customerListUpdateRequest
              completionHandler: ^(CustomerList output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.CustomerListsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var customerListId = customerListId_example; // {String} Unique identifier of a customer list
var customerListUpdateRequest = ; // {CustomerListUpdateRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.customerLists/update(adAccountId, customerListId, customerListUpdateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class customerLists/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new CustomerListsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var customerListId = customerListId_example;  // String | Unique identifier of a customer list (default to null)
            var customerListUpdateRequest = new CustomerListUpdateRequest(); // CustomerListUpdateRequest | 

            try {
                // Update customer list
                CustomerList result = apiInstance.customerLists/update(adAccountId, customerListId, customerListUpdateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling CustomerListsApi.customerLists/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\CustomerListsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$customerListId = customerListId_example; // String | Unique identifier of a customer list
$customerListUpdateRequest = ; // CustomerListUpdateRequest | 

try {
    $result = $api_instance->customerLists/update($adAccountId, $customerListId, $customerListUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerListsApi->customerLists/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::CustomerListsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::CustomerListsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $customerListId = customerListId_example; # String | Unique identifier of a customer list
my $customerListUpdateRequest = WWW::OPenAPIClient::Object::CustomerListUpdateRequest->new(); # CustomerListUpdateRequest | 

eval {
    my $result = $api_instance->customerLists/update(adAccountId => $adAccountId, customerListId => $customerListId, customerListUpdateRequest => $customerListUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling CustomerListsApi->customerLists/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.CustomerListsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
customerListId = customerListId_example # String | Unique identifier of a customer list (default to null)
customerListUpdateRequest =  # CustomerListUpdateRequest | 

try:
    # Update customer list
    api_response = api_instance.customer_lists/update(adAccountId, customerListId, customerListUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CustomerListsApi->customerLists/update: %s\n" % e)
extern crate CustomerListsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let customerListId = customerListId_example; // String
    let customerListUpdateRequest = ; // CustomerListUpdateRequest

    let mut context = CustomerListsApi::Context::default();
    let result = client.customerLists/update(adAccountId, customerListId, customerListUpdateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
customer_list_id*
String
Unique identifier of a customer list
Required
Body parameters
Name Description
customerListUpdateRequest *

Responses


Integrations

integrations/getById

Get integration metadata

Get integration metadata by ID. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations/{id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/integrations/{id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        String id = id_example; // String | Integration ID.

        try {
            IntegrationRecord result = apiInstance.integrations/getById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrations/getById");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String id = new String(); // String | Integration ID.

try {
    final result = await api_instance.integrations/getById(id);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrations/getById: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        String id = id_example; // String | Integration ID.

        try {
            IntegrationRecord result = apiInstance.integrations/getById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrations/getById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
String *id = id_example; // Integration ID. (default to null)

// Get integration metadata
[apiInstance integrations/getByIdWith:id
              completionHandler: ^(IntegrationRecord output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var id = id_example; // {String} Integration ID.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.integrations/getById(id, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrations/getByIdExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var id = id_example;  // String | Integration ID. (default to null)

            try {
                // Get integration metadata
                IntegrationRecord result = apiInstance.integrations/getById(id);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrations/getById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$id = id_example; // String | Integration ID.

try {
    $result = $api_instance->integrations/getById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrations/getById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $id = id_example; # String | Integration ID.

eval {
    my $result = $api_instance->integrations/getById(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrations/getById: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
id = id_example # String | Integration ID. (default to null)

try:
    # Get integration metadata
    api_response = api_instance.integrations/get_by_id(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrations/getById: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let id = id_example; // String

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrations/getById(id, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
id*
String
Integration ID.
Required

Responses


integrations/getList

Get integration metadata list

Get integration metadata list. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/integrations?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            integrations_get_list_200_response result = apiInstance.integrations/getList(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrations/getList");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.integrations/getList(bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrations/getList: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            integrations_get_list_200_response result = apiInstance.integrations/getList(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrations/getList");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// Get integration metadata list
[apiInstance integrations/getListWith:bookmark
    pageSize:pageSize
              completionHandler: ^(integrations_get_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.integrations/getList(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrations/getListExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // Get integration metadata list
                integrations_get_list_200_response result = apiInstance.integrations/getList(bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrations/getList: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->integrations/getList($bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrations/getList: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->integrations/getList(bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrations/getList: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # Get integration metadata list
    api_response = api_instance.integrations/get_list(bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrations/getList: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrations/getList(bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


integrationsCommerce/del

Delete commerce integration

Delete commerce integration metadata for the given external business ID. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations/commerce/{external_business_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/integrations/commerce/{external_business_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        String externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.

        try {
            apiInstance.integrationsCommerce/del(externalBusinessId);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/del");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String externalBusinessId = new String(); // String | External business ID for the integration.

try {
    final result = await api_instance.integrationsCommerce/del(externalBusinessId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrationsCommerce/del: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        String externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.

        try {
            apiInstance.integrationsCommerce/del(externalBusinessId);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/del");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
String *externalBusinessId = externalBusinessId_example; // External business ID for the integration. (default to null)

// Delete commerce integration
[apiInstance integrationsCommerce/delWith:externalBusinessId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var externalBusinessId = externalBusinessId_example; // {String} External business ID for the integration.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.integrationsCommerce/del(externalBusinessId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrationsCommerce/delExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var externalBusinessId = externalBusinessId_example;  // String | External business ID for the integration. (default to null)

            try {
                // Delete commerce integration
                apiInstance.integrationsCommerce/del(externalBusinessId);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrationsCommerce/del: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.

try {
    $api_instance->integrationsCommerce/del($externalBusinessId);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrationsCommerce/del: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $externalBusinessId = externalBusinessId_example; # String | External business ID for the integration.

eval {
    $api_instance->integrationsCommerce/del(externalBusinessId => $externalBusinessId);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrationsCommerce/del: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
externalBusinessId = externalBusinessId_example # String | External business ID for the integration. (default to null)

try:
    # Delete commerce integration
    api_instance.integrations_commerce/del(externalBusinessId)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrationsCommerce/del: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let externalBusinessId = externalBusinessId_example; // String

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrationsCommerce/del(externalBusinessId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
external_business_id*
String
External business ID for the integration.
Required

Responses


integrationsCommerce/get

Get commerce integration

Get commerce integration metadata associated with the given external business ID. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations/commerce/{external_business_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/integrations/commerce/{external_business_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        String externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.

        try {
            IntegrationMetadata result = apiInstance.integrationsCommerce/get(externalBusinessId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String externalBusinessId = new String(); // String | External business ID for the integration.

try {
    final result = await api_instance.integrationsCommerce/get(externalBusinessId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrationsCommerce/get: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        String externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.

        try {
            IntegrationMetadata result = apiInstance.integrationsCommerce/get(externalBusinessId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
String *externalBusinessId = externalBusinessId_example; // External business ID for the integration. (default to null)

// Get commerce integration
[apiInstance integrationsCommerce/getWith:externalBusinessId
              completionHandler: ^(IntegrationMetadata output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var externalBusinessId = externalBusinessId_example; // {String} External business ID for the integration.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.integrationsCommerce/get(externalBusinessId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrationsCommerce/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var externalBusinessId = externalBusinessId_example;  // String | External business ID for the integration. (default to null)

            try {
                // Get commerce integration
                IntegrationMetadata result = apiInstance.integrationsCommerce/get(externalBusinessId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrationsCommerce/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.

try {
    $result = $api_instance->integrationsCommerce/get($externalBusinessId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrationsCommerce/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $externalBusinessId = externalBusinessId_example; # String | External business ID for the integration.

eval {
    my $result = $api_instance->integrationsCommerce/get(externalBusinessId => $externalBusinessId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrationsCommerce/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
externalBusinessId = externalBusinessId_example # String | External business ID for the integration. (default to null)

try:
    # Get commerce integration
    api_response = api_instance.integrations_commerce/get(externalBusinessId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrationsCommerce/get: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let externalBusinessId = externalBusinessId_example; // String

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrationsCommerce/get(externalBusinessId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
external_business_id*
String
External business ID for the integration.
Required

Responses


integrationsCommerce/patch

Update commerce integration

Update commerce integration metadata for the given external business ID. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations/commerce/{external_business_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/integrations/commerce/{external_business_id}" \
 -d '{
  "connected_advertiser_id" : "connected_advertiser_id",
  "connected_lba_id" : "connected_lba_id",
  "partner_primary_email" : "partner_primary_email",
  "connected_tag_id" : "connected_tag_id",
  "partner_refresh_token" : "partner_refresh_token",
  "additional_id_1" : "additional_id_1",
  "connected_merchant_id" : "connected_merchant_id",
  "scopes" : "scopes",
  "partner_metadata" : "partner_metadata",
  "partner_access_token" : "partner_access_token",
  "partner_access_token_expiry" : 0.8008281904610115,
  "partner_refresh_token_expiry" : 6.027456183070403
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        String externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.
        IntegrationRequestPatch integrationRequestPatch = ; // IntegrationRequestPatch | 

        try {
            IntegrationMetadata result = apiInstance.integrationsCommerce/patch(externalBusinessId, integrationRequestPatch);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/patch");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String externalBusinessId = new String(); // String | External business ID for the integration.
final IntegrationRequestPatch integrationRequestPatch = new IntegrationRequestPatch(); // IntegrationRequestPatch | 

try {
    final result = await api_instance.integrationsCommerce/patch(externalBusinessId, integrationRequestPatch);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrationsCommerce/patch: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        String externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.
        IntegrationRequestPatch integrationRequestPatch = ; // IntegrationRequestPatch | 

        try {
            IntegrationMetadata result = apiInstance.integrationsCommerce/patch(externalBusinessId, integrationRequestPatch);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/patch");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
String *externalBusinessId = externalBusinessId_example; // External business ID for the integration. (default to null)
IntegrationRequestPatch *integrationRequestPatch = ; //  (optional)

// Update commerce integration
[apiInstance integrationsCommerce/patchWith:externalBusinessId
    integrationRequestPatch:integrationRequestPatch
              completionHandler: ^(IntegrationMetadata output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var externalBusinessId = externalBusinessId_example; // {String} External business ID for the integration.
var opts = {
  'integrationRequestPatch':  // {IntegrationRequestPatch} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.integrationsCommerce/patch(externalBusinessId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrationsCommerce/patchExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var externalBusinessId = externalBusinessId_example;  // String | External business ID for the integration. (default to null)
            var integrationRequestPatch = new IntegrationRequestPatch(); // IntegrationRequestPatch |  (optional) 

            try {
                // Update commerce integration
                IntegrationMetadata result = apiInstance.integrationsCommerce/patch(externalBusinessId, integrationRequestPatch);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrationsCommerce/patch: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$externalBusinessId = externalBusinessId_example; // String | External business ID for the integration.
$integrationRequestPatch = ; // IntegrationRequestPatch | 

try {
    $result = $api_instance->integrationsCommerce/patch($externalBusinessId, $integrationRequestPatch);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrationsCommerce/patch: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $externalBusinessId = externalBusinessId_example; # String | External business ID for the integration.
my $integrationRequestPatch = WWW::OPenAPIClient::Object::IntegrationRequestPatch->new(); # IntegrationRequestPatch | 

eval {
    my $result = $api_instance->integrationsCommerce/patch(externalBusinessId => $externalBusinessId, integrationRequestPatch => $integrationRequestPatch);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrationsCommerce/patch: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
externalBusinessId = externalBusinessId_example # String | External business ID for the integration. (default to null)
integrationRequestPatch =  # IntegrationRequestPatch |  (optional)

try:
    # Update commerce integration
    api_response = api_instance.integrations_commerce/patch(externalBusinessId, integrationRequestPatch=integrationRequestPatch)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrationsCommerce/patch: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let externalBusinessId = externalBusinessId_example; // String
    let integrationRequestPatch = ; // IntegrationRequestPatch

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrationsCommerce/patch(externalBusinessId, integrationRequestPatch, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
external_business_id*
String
External business ID for the integration.
Required
Body parameters
Name Description
integrationRequestPatch

Parameters to get create/update the Integration Metadata

Responses


integrationsCommerce/post

Create commerce integration

Create commerce integration metadata to link an external business ID with a Pinterest merchant & ad account. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations/commerce

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/integrations/commerce" \
 -d '{
  "connected_advertiser_id" : "connected_advertiser_id",
  "partner_primary_email" : "partner_primary_email",
  "connected_tag_id" : "connected_tag_id",
  "partner_metadata" : "partner_metadata",
  "partner_access_token" : "partner_access_token",
  "partner_refresh_token_expiry" : 6,
  "external_business_id" : "external_business_id",
  "connected_lba_id" : "connected_lba_id",
  "partner_refresh_token" : "partner_refresh_token",
  "additional_id_1" : "additional_id_1",
  "connected_merchant_id" : "connected_merchant_id",
  "scopes" : "scopes",
  "partner_access_token_expiry" : 0
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        IntegrationRequest integrationRequest = ; // IntegrationRequest | 

        try {
            IntegrationMetadata result = apiInstance.integrationsCommerce/post(integrationRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/post");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final IntegrationRequest integrationRequest = new IntegrationRequest(); // IntegrationRequest | 

try {
    final result = await api_instance.integrationsCommerce/post(integrationRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrationsCommerce/post: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        IntegrationRequest integrationRequest = ; // IntegrationRequest | 

        try {
            IntegrationMetadata result = apiInstance.integrationsCommerce/post(integrationRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsCommerce/post");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
IntegrationRequest *integrationRequest = ; //  (optional)

// Create commerce integration
[apiInstance integrationsCommerce/postWith:integrationRequest
              completionHandler: ^(IntegrationMetadata output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var opts = {
  'integrationRequest':  // {IntegrationRequest} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.integrationsCommerce/post(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrationsCommerce/postExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var integrationRequest = new IntegrationRequest(); // IntegrationRequest |  (optional) 

            try {
                // Create commerce integration
                IntegrationMetadata result = apiInstance.integrationsCommerce/post(integrationRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrationsCommerce/post: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$integrationRequest = ; // IntegrationRequest | 

try {
    $result = $api_instance->integrationsCommerce/post($integrationRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrationsCommerce/post: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $integrationRequest = WWW::OPenAPIClient::Object::IntegrationRequest->new(); # IntegrationRequest | 

eval {
    my $result = $api_instance->integrationsCommerce/post(integrationRequest => $integrationRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrationsCommerce/post: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
integrationRequest =  # IntegrationRequest |  (optional)

try:
    # Create commerce integration
    api_response = api_instance.integrations_commerce/post(integrationRequest=integrationRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrationsCommerce/post: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let integrationRequest = ; // IntegrationRequest

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrationsCommerce/post(integrationRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Body parameters
Name Description
integrationRequest

Parameters to get create/update the Integration Metadata

Responses


integrationsLogs/post

Receives batched logs from integration applications.

This endpoint receives batched logs from integration applications on partner platforms. Note: If you're interested in joining the beta, please reach out to your Pinterest account manager.


/integrations/logs

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/integrations/logs" \
 -d '{
  "logs" : [ {
    "client_timestamp" : 0,
    "app_version_number" : "app_version_number",
    "request" : {
      "path" : "path",
      "response_headers" : {
        "key" : "response_headers"
      },
      "method" : "GET",
      "host" : "host",
      "request_headers" : {
        "key" : "request_headers"
      },
      "response_status_code" : 5
    },
    "log_level" : "INFO",
    "merchant_id" : "merchant_id",
    "message" : "message",
    "error" : {
      "number" : 5,
      "file_name" : "file_name",
      "line_number" : 1,
      "name" : "name",
      "cause" : "cause",
      "column_number" : 6,
      "stack_trace" : "stack_trace",
      "message" : "message",
      "message_detail" : "message_detail"
    },
    "platform_version_number" : "platform_version_number",
    "advertiser_id" : "advertiser_id",
    "external_business_id" : "external_business_id",
    "event_type" : "APP",
    "tag_id" : "tag_id",
    "feed_profile_id" : "feed_profile_id"
  }, {
    "client_timestamp" : 0,
    "app_version_number" : "app_version_number",
    "request" : {
      "path" : "path",
      "response_headers" : {
        "key" : "response_headers"
      },
      "method" : "GET",
      "host" : "host",
      "request_headers" : {
        "key" : "request_headers"
      },
      "response_status_code" : 5
    },
    "log_level" : "INFO",
    "merchant_id" : "merchant_id",
    "message" : "message",
    "error" : {
      "number" : 5,
      "file_name" : "file_name",
      "line_number" : 1,
      "name" : "name",
      "cause" : "cause",
      "column_number" : 6,
      "stack_trace" : "stack_trace",
      "message" : "message",
      "message_detail" : "message_detail"
    },
    "platform_version_number" : "platform_version_number",
    "advertiser_id" : "advertiser_id",
    "external_business_id" : "external_business_id",
    "event_type" : "APP",
    "tag_id" : "tag_id",
    "feed_profile_id" : "feed_profile_id"
  } ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.IntegrationsApi;

import java.io.File;
import java.util.*;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        IntegrationsApi apiInstance = new IntegrationsApi();
        IntegrationLogsRequest integrationLogsRequest = ; // IntegrationLogsRequest | 

        try {
            IntegrationLogsSuccessResponse result = apiInstance.integrationsLogs/post(integrationLogsRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsLogs/post");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final IntegrationLogsRequest integrationLogsRequest = new IntegrationLogsRequest(); // IntegrationLogsRequest | 

try {
    final result = await api_instance.integrationsLogs/post(integrationLogsRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->integrationsLogs/post: $e\n');
}

import org.openapitools.client.api.IntegrationsApi;

public class IntegrationsApiExample {
    public static void main(String[] args) {
        IntegrationsApi apiInstance = new IntegrationsApi();
        IntegrationLogsRequest integrationLogsRequest = ; // IntegrationLogsRequest | 

        try {
            IntegrationLogsSuccessResponse result = apiInstance.integrationsLogs/post(integrationLogsRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IntegrationsApi#integrationsLogs/post");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
IntegrationsApi *apiInstance = [[IntegrationsApi alloc] init];
IntegrationLogsRequest *integrationLogsRequest = ; // 

// Receives batched logs from integration applications.
[apiInstance integrationsLogs/postWith:integrationLogsRequest
              completionHandler: ^(IntegrationLogsSuccessResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.IntegrationsApi()
var integrationLogsRequest = ; // {IntegrationLogsRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.integrationsLogs/post(integrationLogsRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class integrationsLogs/postExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new IntegrationsApi();
            var integrationLogsRequest = new IntegrationLogsRequest(); // IntegrationLogsRequest | 

            try {
                // Receives batched logs from integration applications.
                IntegrationLogsSuccessResponse result = apiInstance.integrationsLogs/post(integrationLogsRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling IntegrationsApi.integrationsLogs/post: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\IntegrationsApi();
$integrationLogsRequest = ; // IntegrationLogsRequest | 

try {
    $result = $api_instance->integrationsLogs/post($integrationLogsRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling IntegrationsApi->integrationsLogs/post: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::IntegrationsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::IntegrationsApi->new();
my $integrationLogsRequest = WWW::OPenAPIClient::Object::IntegrationLogsRequest->new(); # IntegrationLogsRequest | 

eval {
    my $result = $api_instance->integrationsLogs/post(integrationLogsRequest => $integrationLogsRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling IntegrationsApi->integrationsLogs/post: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.IntegrationsApi()
integrationLogsRequest =  # IntegrationLogsRequest | 

try:
    # Receives batched logs from integration applications.
    api_response = api_instance.integrations_logs/post(integrationLogsRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling IntegrationsApi->integrationsLogs/post: %s\n" % e)
extern crate IntegrationsApi;

pub fn main() {
    let integrationLogsRequest = ; // IntegrationLogsRequest

    let mut context = IntegrationsApi::Context::default();
    let result = client.integrationsLogs/post(integrationLogsRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Body parameters
Name Description
integrationLogsRequest *

Ingest log information from external integration application.

Responses


Keywords

countryKeywordsMetrics/get

Get country's keyword metrics

See keyword metrics for a specified country, aggregated across all of Pinterest. (Definitions are available from the "Get delivery metrics definitions" <a href="/docs/api/v5/#operation/delivery_metrics/get">API endpoint</a>).


/ad_accounts/{ad_account_id}/keywords/metrics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/keywords/metrics?country_code=US&keywords="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.KeywordsApi;

import java.io.File;
import java.util.*;

public class KeywordsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String countryCode = US; // String | Two letter country code (ISO 3166-1 alpha-2)
        array[String] keywords = ; // array[String] | Comma-separated keywords

        try {
            KeywordsMetricsArrayResponse result = apiInstance.countryKeywordsMetrics/get(adAccountId, countryCode, keywords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#countryKeywordsMetrics/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String countryCode = new String(); // String | Two letter country code (ISO 3166-1 alpha-2)
final array[String] keywords = new array[String](); // array[String] | Comma-separated keywords

try {
    final result = await api_instance.countryKeywordsMetrics/get(adAccountId, countryCode, keywords);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->countryKeywordsMetrics/get: $e\n');
}

import org.openapitools.client.api.KeywordsApi;

public class KeywordsApiExample {
    public static void main(String[] args) {
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String countryCode = US; // String | Two letter country code (ISO 3166-1 alpha-2)
        array[String] keywords = ; // array[String] | Comma-separated keywords

        try {
            KeywordsMetricsArrayResponse result = apiInstance.countryKeywordsMetrics/get(adAccountId, countryCode, keywords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#countryKeywordsMetrics/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
KeywordsApi *apiInstance = [[KeywordsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *countryCode = US; // Two letter country code (ISO 3166-1 alpha-2) (default to null)
array[String] *keywords = ; // Comma-separated keywords (default to null)

// Get country's keyword metrics
[apiInstance countryKeywordsMetrics/getWith:adAccountId
    countryCode:countryCode
    keywords:keywords
              completionHandler: ^(KeywordsMetricsArrayResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.KeywordsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var countryCode = US; // {String} Two letter country code (ISO 3166-1 alpha-2)
var keywords = ; // {array[String]} Comma-separated keywords

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.countryKeywordsMetrics/get(adAccountId, countryCode, keywords, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class countryKeywordsMetrics/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new KeywordsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var countryCode = US;  // String | Two letter country code (ISO 3166-1 alpha-2) (default to null)
            var keywords = new array[String](); // array[String] | Comma-separated keywords (default to null)

            try {
                // Get country's keyword metrics
                KeywordsMetricsArrayResponse result = apiInstance.countryKeywordsMetrics/get(adAccountId, countryCode, keywords);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling KeywordsApi.countryKeywordsMetrics/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\KeywordsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$countryCode = US; // String | Two letter country code (ISO 3166-1 alpha-2)
$keywords = ; // array[String] | Comma-separated keywords

try {
    $result = $api_instance->countryKeywordsMetrics/get($adAccountId, $countryCode, $keywords);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling KeywordsApi->countryKeywordsMetrics/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::KeywordsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::KeywordsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $countryCode = US; # String | Two letter country code (ISO 3166-1 alpha-2)
my $keywords = []; # array[String] | Comma-separated keywords

eval {
    my $result = $api_instance->countryKeywordsMetrics/get(adAccountId => $adAccountId, countryCode => $countryCode, keywords => $keywords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling KeywordsApi->countryKeywordsMetrics/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.KeywordsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
countryCode = US # String | Two letter country code (ISO 3166-1 alpha-2) (default to null)
keywords =  # array[String] | Comma-separated keywords (default to null)

try:
    # Get country's keyword metrics
    api_response = api_instance.country_keywords_metrics/get(adAccountId, countryCode, keywords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling KeywordsApi->countryKeywordsMetrics/get: %s\n" % e)
extern crate KeywordsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let countryCode = US; // String
    let keywords = ; // array[String]

    let mut context = KeywordsApi::Context::default();
    let result = client.countryKeywordsMetrics/get(adAccountId, countryCode, keywords, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
country_code*
String
Two letter country code (ISO 3166-1 alpha-2)
Required
keywords*
array[String]
Comma-separated keywords
Required

Responses


keywords/create

Create keywords

<p>Create keywords for following entity types(advertiser, campaign, ad group or ad).</p> <p>For more information, see <a target="_blank" href="https://help.pinterest.com/en/business/article/keyword-targeting">Keyword targeting</a>.</p> <p><b>Notes:</b></p> <ul style="list-style-type: square;"> <li>Advertisers and campaigns can only be assigned keywords with excluding ('_NEGATIVE').</li> <li>All keyword match types are available for ad groups.</li> </ul> <p>For more information on match types, see <a target="_blank" href="/docs/ads/targeting/#Match%20type%20and%20targeting%20level">match type enums</a>.</p> <p><b>Returns:</b></p> <ul style="list-style-type: square;"> <li><p>A successful call returns an object containing an array of new keyword objects and an empty &quot;errors&quot; object array.</p></li> <li><p>An unsuccessful call returns an empty keywords array, and, instead, inserts the entire object with nulled/negated properties into the &quot;errors&quot; object array:</p> <pre class="last literal-block"> { "keywords": [], "errors": [ { "data": { "archived": null, "match_type": "EXACT", "parent_type": null, "value": "foobar", "parent_id": null, "type": "keyword", "id": null }, "error_messages": [ "Advertisers and Campaigns only accept excluded targeting attributes." ] } } </pre></li> </ul> <p><b>Rate limit</b>: <a href="/docs/redoc/#tag/Rate-Limits">WRITE</a>.</p>


/ad_accounts/{ad_account_id}/keywords

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/keywords" \
 -d '{
  "keywords" : [ {
    "match_type" : "BROAD",
    "bid" : 200000,
    "value" : "value"
  }, {
    "match_type" : "BROAD",
    "bid" : 200000,
    "value" : "value"
  } ],
  "parent_id" : "383791336903426391"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.KeywordsApi;

import java.io.File;
import java.util.*;

public class KeywordsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        KeywordsRequest keywordsRequest = ; // KeywordsRequest | 

        try {
            KeywordsResponse result = apiInstance.keywords/create(adAccountId, keywordsRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#keywords/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final KeywordsRequest keywordsRequest = new KeywordsRequest(); // KeywordsRequest | 

try {
    final result = await api_instance.keywords/create(adAccountId, keywordsRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->keywords/create: $e\n');
}

import org.openapitools.client.api.KeywordsApi;

public class KeywordsApiExample {
    public static void main(String[] args) {
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        KeywordsRequest keywordsRequest = ; // KeywordsRequest | 

        try {
            KeywordsResponse result = apiInstance.keywords/create(adAccountId, keywordsRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#keywords/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
KeywordsApi *apiInstance = [[KeywordsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
KeywordsRequest *keywordsRequest = ; // 

// Create keywords
[apiInstance keywords/createWith:adAccountId
    keywordsRequest:keywordsRequest
              completionHandler: ^(KeywordsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.KeywordsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var keywordsRequest = ; // {KeywordsRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.keywords/create(adAccountId, keywordsRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class keywords/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new KeywordsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var keywordsRequest = new KeywordsRequest(); // KeywordsRequest | 

            try {
                // Create keywords
                KeywordsResponse result = apiInstance.keywords/create(adAccountId, keywordsRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling KeywordsApi.keywords/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\KeywordsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$keywordsRequest = ; // KeywordsRequest | 

try {
    $result = $api_instance->keywords/create($adAccountId, $keywordsRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling KeywordsApi->keywords/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::KeywordsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::KeywordsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $keywordsRequest = WWW::OPenAPIClient::Object::KeywordsRequest->new(); # KeywordsRequest | 

eval {
    my $result = $api_instance->keywords/create(adAccountId => $adAccountId, keywordsRequest => $keywordsRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling KeywordsApi->keywords/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.KeywordsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
keywordsRequest =  # KeywordsRequest | 

try:
    # Create keywords
    api_response = api_instance.keywords/create(adAccountId, keywordsRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling KeywordsApi->keywords/create: %s\n" % e)
extern crate KeywordsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let keywordsRequest = ; // KeywordsRequest

    let mut context = KeywordsApi::Context::default();
    let result = client.keywords/create(adAccountId, keywordsRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
keywordsRequest *

Responses


keywords/get

Get keywords

<p>Get a list of keywords based on the filters provided. If no filter is provided, it will default to the ad_account_id filter, which means it will only return keywords that specifically have parent_id set to the ad_account_id. Note: Keywords can have ad_account_ids, campaign_ids, and ad_group_ids set as their parent_ids. Keywords created through Ads Manager will have their parent_id set to an ad_group_id, not ad_account_id.</p> <p>For more information, see <a target="_blank" href="https://help.pinterest.com/en/business/article/keyword-targeting">Keyword targeting</a>.</p> <p><b>Notes:</b></p> <ul style="list-style-type: square;"> <li>Advertisers and campaigns can only be assigned keywords with excluding ('_NEGATIVE').</li> <li>All keyword match types are available for ad groups.</li> </ul> <p>For more information on match types, see <a target="_blank" href="/docs/ads/targeting/#Match%20type%20and%20targeting%20level">match type enums</a>.</p> <p><b>Returns:</b></p> <ul style="list-style-type: square;"> <li><p>A successful call returns an object containing an array of new keyword objects and an empty &quot;errors&quot; object array.</p></li> <li><p>An unsuccessful call returns an empty keywords array, and, instead, inserts the entire object with nulled/negated properties into the &quot;errors&quot; object array:</p> <pre class="last literal-block"> { "keywords": [], "errors": [ { "data": { "archived": null, "match_type": "EXACT", "parent_type": null, "value": "foobar", "parent_id": null, "type": "keyword", "id": null }, "error_messages": [ "Advertisers and Campaigns only accept excluded targeting attributes." ] } } </pre></li> </ul>


/ad_accounts/{ad_account_id}/keywords

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/keywords?campaign_id=campaignId_example&ad_group_id=123123123&match_types=&page_size=56&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.KeywordsApi;

import java.io.File;
import java.util.*;

public class KeywordsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String campaignId = campaignId_example; // String | Campaign Id to use to filter the results.
        String adGroupId = 123123123; // String | Ad group Id.
        array[MatchType] matchTypes = ; // array[MatchType] | Keyword match type
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            keywords_get_200_response result = apiInstance.keywords/get(adAccountId, campaignId, adGroupId, matchTypes, pageSize, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#keywords/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String campaignId = new String(); // String | Campaign Id to use to filter the results.
final String adGroupId = new String(); // String | Ad group Id.
final array[MatchType] matchTypes = new array[MatchType](); // array[MatchType] | Keyword match type
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.keywords/get(adAccountId, campaignId, adGroupId, matchTypes, pageSize, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->keywords/get: $e\n');
}

import org.openapitools.client.api.KeywordsApi;

public class KeywordsApiExample {
    public static void main(String[] args) {
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String campaignId = campaignId_example; // String | Campaign Id to use to filter the results.
        String adGroupId = 123123123; // String | Ad group Id.
        array[MatchType] matchTypes = ; // array[MatchType] | Keyword match type
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            keywords_get_200_response result = apiInstance.keywords/get(adAccountId, campaignId, adGroupId, matchTypes, pageSize, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#keywords/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
KeywordsApi *apiInstance = [[KeywordsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *campaignId = campaignId_example; // Campaign Id to use to filter the results. (optional) (default to null)
String *adGroupId = 123123123; // Ad group Id. (optional) (default to null)
array[MatchType] *matchTypes = ; // Keyword match type (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get keywords
[apiInstance keywords/getWith:adAccountId
    campaignId:campaignId
    adGroupId:adGroupId
    matchTypes:matchTypes
    pageSize:pageSize
    bookmark:bookmark
              completionHandler: ^(keywords_get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.KeywordsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'campaignId': campaignId_example, // {String} Campaign Id to use to filter the results.
  'adGroupId': 123123123, // {String} Ad group Id.
  'matchTypes': , // {array[MatchType]} Keyword match type
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.keywords/get(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class keywords/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new KeywordsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var campaignId = campaignId_example;  // String | Campaign Id to use to filter the results. (optional)  (default to null)
            var adGroupId = 123123123;  // String | Ad group Id. (optional)  (default to null)
            var matchTypes = new array[MatchType](); // array[MatchType] | Keyword match type (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get keywords
                keywords_get_200_response result = apiInstance.keywords/get(adAccountId, campaignId, adGroupId, matchTypes, pageSize, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling KeywordsApi.keywords/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\KeywordsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$campaignId = campaignId_example; // String | Campaign Id to use to filter the results.
$adGroupId = 123123123; // String | Ad group Id.
$matchTypes = ; // array[MatchType] | Keyword match type
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->keywords/get($adAccountId, $campaignId, $adGroupId, $matchTypes, $pageSize, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling KeywordsApi->keywords/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::KeywordsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::KeywordsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $campaignId = campaignId_example; # String | Campaign Id to use to filter the results.
my $adGroupId = 123123123; # String | Ad group Id.
my $matchTypes = []; # array[MatchType] | Keyword match type
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->keywords/get(adAccountId => $adAccountId, campaignId => $campaignId, adGroupId => $adGroupId, matchTypes => $matchTypes, pageSize => $pageSize, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling KeywordsApi->keywords/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.KeywordsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
campaignId = campaignId_example # String | Campaign Id to use to filter the results. (optional) (default to null)
adGroupId = 123123123 # String | Ad group Id. (optional) (default to null)
matchTypes =  # array[MatchType] | Keyword match type (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get keywords
    api_response = api_instance.keywords/get(adAccountId, campaignId=campaignId, adGroupId=adGroupId, matchTypes=matchTypes, pageSize=pageSize, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling KeywordsApi->keywords/get: %s\n" % e)
extern crate KeywordsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let campaignId = campaignId_example; // String
    let adGroupId = 123123123; // String
    let matchTypes = ; // array[MatchType]
    let pageSize = 56; // Integer
    let bookmark = bookmark_example; // String

    let mut context = KeywordsApi::Context::default();
    let result = client.keywords/get(adAccountId, campaignId, adGroupId, matchTypes, pageSize, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
campaign_id
String
Campaign Id to use to filter the results.
ad_group_id
String
Ad group Id.
match_types
array[MatchType]
Keyword <a target="_blank" href="/docs/ads/targeting/#Match%20type%20and%20targeting%20level">match type</a>
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
bookmark
String
Cursor used to fetch the next page of items

Responses


keywords/update

Update keywords

<p>Update one or more keywords' bid and archived fields.</p> <p>Archiving a keyword effectively deletes it - keywords no longer receive metrics and no longer visible within the parent entity's keywords list.</p>


/ad_accounts/{ad_account_id}/keywords

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/keywords" \
 -d '{
  "keywords" : [ {
    "archived" : false,
    "id" : "2886364308355",
    "bid" : 200000
  }, {
    "archived" : false,
    "id" : "2886364308355",
    "bid" : 200000
  } ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.KeywordsApi;

import java.io.File;
import java.util.*;

public class KeywordsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        KeywordUpdateBody keywordUpdateBody = ; // KeywordUpdateBody | 

        try {
            KeywordsResponse result = apiInstance.keywords/update(adAccountId, keywordUpdateBody);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#keywords/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final KeywordUpdateBody keywordUpdateBody = new KeywordUpdateBody(); // KeywordUpdateBody | 

try {
    final result = await api_instance.keywords/update(adAccountId, keywordUpdateBody);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->keywords/update: $e\n');
}

import org.openapitools.client.api.KeywordsApi;

public class KeywordsApiExample {
    public static void main(String[] args) {
        KeywordsApi apiInstance = new KeywordsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        KeywordUpdateBody keywordUpdateBody = ; // KeywordUpdateBody | 

        try {
            KeywordsResponse result = apiInstance.keywords/update(adAccountId, keywordUpdateBody);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling KeywordsApi#keywords/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
KeywordsApi *apiInstance = [[KeywordsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
KeywordUpdateBody *keywordUpdateBody = ; // 

// Update keywords
[apiInstance keywords/updateWith:adAccountId
    keywordUpdateBody:keywordUpdateBody
              completionHandler: ^(KeywordsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.KeywordsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var keywordUpdateBody = ; // {KeywordUpdateBody} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.keywords/update(adAccountId, keywordUpdateBody, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class keywords/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new KeywordsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var keywordUpdateBody = new KeywordUpdateBody(); // KeywordUpdateBody | 

            try {
                // Update keywords
                KeywordsResponse result = apiInstance.keywords/update(adAccountId, keywordUpdateBody);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling KeywordsApi.keywords/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\KeywordsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$keywordUpdateBody = ; // KeywordUpdateBody | 

try {
    $result = $api_instance->keywords/update($adAccountId, $keywordUpdateBody);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling KeywordsApi->keywords/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::KeywordsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::KeywordsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $keywordUpdateBody = WWW::OPenAPIClient::Object::KeywordUpdateBody->new(); # KeywordUpdateBody | 

eval {
    my $result = $api_instance->keywords/update(adAccountId => $adAccountId, keywordUpdateBody => $keywordUpdateBody);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling KeywordsApi->keywords/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.KeywordsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
keywordUpdateBody =  # KeywordUpdateBody | 

try:
    # Update keywords
    api_response = api_instance.keywords/update(adAccountId, keywordUpdateBody)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling KeywordsApi->keywords/update: %s\n" % e)
extern crate KeywordsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let keywordUpdateBody = ; // KeywordUpdateBody

    let mut context = KeywordsApi::Context::default();
    let result = client.keywords/update(adAccountId, keywordUpdateBody, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
keywordUpdateBody *

Responses


trendingKeywords/list

List trending keywords

<p>Get the top trending search keywords among the Pinterest user audience.</p> <p>Trending keywords can be used to inform ad targeting, budget strategy, and creative decisions about which products and Pins will resonate with your audience.</p> <p>Geographic, demographic and interest-based filters are available to narrow down to the top trends among a specific audience. Multiple trend types are supported that can be used to identify newly-popular, evergreen or seasonal keywords.</p> <p>For an interactive way to explore this data, please visit <a href="https://trends.pinterest.com">trends.pinterest.com</a>.


/trends/keywords/{region}/top/{trend_type}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/trends/keywords/{region}/top/{trend_type}?interests=["beauty","womens_fashion"]&genders=["female","unknown"]&ages=["35-44","50-54"]&normalize_against_group=true&limit=25"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.KeywordsApi;

import java.io.File;
import java.util.*;

public class KeywordsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        KeywordsApi apiInstance = new KeywordsApi();
        TrendsSupportedRegion region = ; // TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia TrendType trendType = ; // TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) array[String] interests = ["beauty","womens_fashion"]; // array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion array[String] genders = ["female","unknown"]; // array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. array[String] ages = ["35-44","50-54"]; // array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. Boolean normalizeAgainstGroup = true; // Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. Integer limit = 25; // Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. try { TrendingKeywordsResponse result = apiInstance.trendingKeywords/list(region, trendType, interests, genders, ages, normalizeAgainstGroup, limit); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling KeywordsApi#trendingKeywords/list"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final TrendsSupportedRegion region = new TrendsSupportedRegion(); // TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia final TrendType trendType = new TrendType(); // TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) final array[String] interests = new array[String](); // array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion final array[String] genders = new array[String](); // array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. final array[String] ages = new array[String](); // array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. final Boolean normalizeAgainstGroup = new Boolean(); // Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. final Integer limit = new Integer(); // Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. try { final result = await api_instance.trendingKeywords/list(region, trendType, interests, genders, ages, normalizeAgainstGroup, limit); print(result); } catch (e) { print('Exception when calling DefaultApi->trendingKeywords/list: $e\n'); }
import org.openapitools.client.api.KeywordsApi;

public class KeywordsApiExample {
    public static void main(String[] args) {
        KeywordsApi apiInstance = new KeywordsApi();
        TrendsSupportedRegion region = ; // TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia TrendType trendType = ; // TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) array[String] interests = ["beauty","womens_fashion"]; // array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion array[String] genders = ["female","unknown"]; // array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. array[String] ages = ["35-44","50-54"]; // array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. Boolean normalizeAgainstGroup = true; // Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. Integer limit = 25; // Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. try { TrendingKeywordsResponse result = apiInstance.trendingKeywords/list(region, trendType, interests, genders, ages, normalizeAgainstGroup, limit); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling KeywordsApi#trendingKeywords/list"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
KeywordsApi *apiInstance = [[KeywordsApi alloc] init];
TrendsSupportedRegion *region = ; // The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia (default to null) TrendType *trendType = ; // The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) (default to null) array[String] *interests = ["beauty","womens_fashion"]; // If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion (optional) (default to null) array[String] *genders = ["female","unknown"]; // If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. (optional) (default to null) array[String] *ages = ["35-44","50-54"]; // If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. (optional) (default to null) Boolean *normalizeAgainstGroup = true; // Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. (optional) (default to false) Integer *limit = 25; // The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. (optional) (default to 50) // List trending keywords [apiInstance trendingKeywords/listWith:region trendType:trendType interests:interests genders:genders ages:ages normalizeAgainstGroup:normalizeAgainstGroup limit:limit completionHandler: ^(TrendingKeywordsResponse output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.KeywordsApi()
var region = ; // {TrendsSupportedRegion} The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia var trendType = ; // {TrendType} The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) var opts = { 'interests': ["beauty","womens_fashion"], // {array[String]} If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion 'genders': ["female","unknown"], // {array[String]} If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. 'ages': ["35-44","50-54"], // {array[String]} If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. 'normalizeAgainstGroup': true, // {Boolean} Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. 'limit': 25 // {Integer} The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.trendingKeywords/list(region, trendType, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class trendingKeywords/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new KeywordsApi();
            var region = new TrendsSupportedRegion(); // TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia (default to null) var trendType = new TrendType(); // TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) (default to null) var interests = new array[String](); // array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion (optional) (default to null) var genders = new array[String](); // array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. (optional) (default to null) var ages = new array[String](); // array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. (optional) (default to null) var normalizeAgainstGroup = true; // Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. (optional) (default to false) var limit = 25; // Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. (optional) (default to 50) try { // List trending keywords TrendingKeywordsResponse result = apiInstance.trendingKeywords/list(region, trendType, interests, genders, ages, normalizeAgainstGroup, limit); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling KeywordsApi.trendingKeywords/list: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\KeywordsApi();
$region = ; // TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia $trendType = ; // TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) $interests = ["beauty","womens_fashion"]; // array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion $genders = ["female","unknown"]; // array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. $ages = ["35-44","50-54"]; // array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. $normalizeAgainstGroup = true; // Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. $limit = 25; // Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. try { $result = $api_instance->trendingKeywords/list($region, $trendType, $interests, $genders, $ages, $normalizeAgainstGroup, $limit); print_r($result); } catch (Exception $e) { echo 'Exception when calling KeywordsApi->trendingKeywords/list: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::KeywordsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::KeywordsApi->new();
my $region = ; # TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia my $trendType = ; # TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) my $interests = [["beauty","womens_fashion"]]; # array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion my $genders = [["female","unknown"]]; # array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. my $ages = [["35-44","50-54"]]; # array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. my $normalizeAgainstGroup = true; # Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. my $limit = 25; # Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. eval { my $result = $api_instance->trendingKeywords/list(region => $region, trendType => $trendType, interests => $interests, genders => $genders, ages => $ages, normalizeAgainstGroup => $normalizeAgainstGroup, limit => $limit); print Dumper($result); }; if ($@) { warn "Exception when calling KeywordsApi->trendingKeywords/list: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.KeywordsApi()
region =  # TrendsSupportedRegion | The geographic region of interest. Only top trends within the specified region will be returned.
The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia (default to null) trendType = # TrendType | The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual) (default to null) interests = ["beauty","womens_fashion"] # array[String] | If set, filters the results to trends associated with the specified interests.
If unset, trends for all interests will be returned.
The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion (optional) (default to null) genders = ["female","unknown"] # array[String] | If set, filters the results to trends among users who identify with the specified gender(s).
If unset, trends among all genders will be returned.
The `unknown` group includes users with unspecified or customized gender profile settings. (optional) (default to null) ages = ["35-44","50-54"] # array[String] | If set, filters the results to trends among users in the specified age range(s).
If unset, trends among all age groups will be returned. (optional) (default to null) normalizeAgainstGroup = true # Boolean | Governs how the resulting time series data will be normalized to a [0-100] scale.
By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.
If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords. (optional) (default to false) limit = 25 # Integer | The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends. (optional) (default to 50) try: # List trending keywords api_response = api_instance.trending_keywords/list(region, trendType, interests=interests, genders=genders, ages=ages, normalizeAgainstGroup=normalizeAgainstGroup, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling KeywordsApi->trendingKeywords/list: %s\n" % e)
extern crate KeywordsApi;

pub fn main() {
    let region = ; // TrendsSupportedRegion
    let trendType = ; // TrendType
    let interests = ["beauty","womens_fashion"]; // array[String]
    let genders = ["female","unknown"]; // array[String]
    let ages = ["35-44","50-54"]; // array[String]
    let normalizeAgainstGroup = true; // Boolean
    let limit = 25; // Integer

    let mut context = KeywordsApi::Context::default();
    let result = client.trendingKeywords/list(region, trendType, interests, genders, ages, normalizeAgainstGroup, limit, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Path parameters
Name Description
region*
TrendsSupportedRegion
The geographic region of interest. Only top trends within the specified region will be returned.<br /> The `region` parameter is formatted as ISO 3166-2 country codes delimited by `+`, corresponding to the following geographic areas: - `US` - United States - `CA` - Canada - `DE` - Germany - `FR` - France - `ES` - Spain - `IT` - Italy - `DE+AT+CH` - Germanic countries - `GB+IE` - Great Britain & Ireland - `IT+ES+PT+GR+MT` - Southern Europe - `PL+RO+HU+SK+CZ` - Eastern Europe - `SE+DK+FI+NO` - Nordic countries - `NL+BE+LU` - Benelux - `AR` - Argentina - `BR` - Brazil - `CO` - Colombia - `MX` - Mexico - `MX+AR+CO+CL` - Hispanic LatAm - `AU+NZ` - Australasia
Required
trend_type*
TrendType
The methodology used to rank how trendy a keyword is. - `growing` trends have high upward growth in search volume over the last quarter - `monthly` trends have high search volume in the last month - `yearly` trends have high search volume in the last year - `seasonal` trends have high upward growth in search volume over the last month and exhibit a seasonal recurring pattern (typically annual)
Required
Query parameters
Name Description
interests
array[String]
If set, filters the results to trends associated with the specified interests.<br /> If unset, trends for all interests will be returned.<br /> The list of supported interests is: - `animals` - Animals - `architecture` - Architecture - `art` - Art - `beauty` - Beauty - `childrens_fashion` - Children's Fashion - `design` - Design - `diy_and_crafts` - DIY & Crafts - `education` - Education - `electronics` - Electronics - `entertainment` - Entertainment - `event_planning` - Event Planning - `finance` - Finance - `food_and_drinks` - Food & Drink - `gardening` - Gardening - `health` - Health - `home_decor` - Home Decor - `mens_fashion` - Men's Fashion - `parenting` - Parenting - `quotes` - Quotes - `sport` - Sports - `travel` - Travel - `vehicles` - Vehicles - `wedding` - Wedding - `womens_fashion` - Women's Fashion
genders
array[String]
If set, filters the results to trends among users who identify with the specified gender(s).<br /> If unset, trends among all genders will be returned.<br /> The `unknown` group includes users with unspecified or customized gender profile settings.
ages
array[String]
If set, filters the results to trends among users in the specified age range(s).<br /> If unset, trends among all age groups will be returned.
normalize_against_group
Boolean
Governs how the resulting time series data will be normalized to a [0-100] scale.<br /> By default (`false`), the data will be normalized independently for each keyword. The peak search volume observation in *each* keyword's time series will be represented by the value 100. This is ideal for analyzing when an individual keyword is expected to peak in interest.<br /> If set to `true`, the data will be normalized as a group. The peak search volume observation across *all* keywords in the response will be represented by the value 100, and all other values scaled accordingly. Use this option when you wish to compare relative search volume between multiple keywords.
limit
Integer
The maximum number of trending keywords that will be returned. Keywords are returned in trend-ranked order, so a `limit` of 50 will return the top 50 trends.

Responses


LeadAds

adAccountsSubscriptions/delById

Delete lead ads subscription

Delete an existing lead ads webhook subscription by ID. - Only requests for the OWNER or ADMIN of the ad_account will be allowed. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/leads/subscriptions/{subscription_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/leads/subscriptions/{subscription_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadAdsApi;

import java.io.File;
import java.util.*;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String subscriptionId = subscriptionId_example; // String | Unique identifier of a subscription.

        try {
            apiInstance.adAccountsSubscriptions/delById(adAccountId, subscriptionId);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/delById");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String subscriptionId = new String(); // String | Unique identifier of a subscription.

try {
    final result = await api_instance.adAccountsSubscriptions/delById(adAccountId, subscriptionId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccountsSubscriptions/delById: $e\n');
}

import org.openapitools.client.api.LeadAdsApi;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String subscriptionId = subscriptionId_example; // String | Unique identifier of a subscription.

        try {
            apiInstance.adAccountsSubscriptions/delById(adAccountId, subscriptionId);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/delById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadAdsApi *apiInstance = [[LeadAdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *subscriptionId = subscriptionId_example; // Unique identifier of a subscription. (default to null)

// Delete lead ads subscription
[apiInstance adAccountsSubscriptions/delByIdWith:adAccountId
    subscriptionId:subscriptionId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadAdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var subscriptionId = subscriptionId_example; // {String} Unique identifier of a subscription.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.adAccountsSubscriptions/delById(adAccountId, subscriptionId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountsSubscriptions/delByIdExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadAdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var subscriptionId = subscriptionId_example;  // String | Unique identifier of a subscription. (default to null)

            try {
                // Delete lead ads subscription
                apiInstance.adAccountsSubscriptions/delById(adAccountId, subscriptionId);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadAdsApi.adAccountsSubscriptions/delById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadAdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$subscriptionId = subscriptionId_example; // String | Unique identifier of a subscription.

try {
    $api_instance->adAccountsSubscriptions/delById($adAccountId, $subscriptionId);
} catch (Exception $e) {
    echo 'Exception when calling LeadAdsApi->adAccountsSubscriptions/delById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadAdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadAdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $subscriptionId = subscriptionId_example; # String | Unique identifier of a subscription.

eval {
    $api_instance->adAccountsSubscriptions/delById(adAccountId => $adAccountId, subscriptionId => $subscriptionId);
};
if ($@) {
    warn "Exception when calling LeadAdsApi->adAccountsSubscriptions/delById: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadAdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
subscriptionId = subscriptionId_example # String | Unique identifier of a subscription. (default to null)

try:
    # Delete lead ads subscription
    api_instance.ad_accounts_subscriptions/del_by_id(adAccountId, subscriptionId)
except ApiException as e:
    print("Exception when calling LeadAdsApi->adAccountsSubscriptions/delById: %s\n" % e)
extern crate LeadAdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let subscriptionId = subscriptionId_example; // String

    let mut context = LeadAdsApi::Context::default();
    let result = client.adAccountsSubscriptions/delById(adAccountId, subscriptionId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
subscription_id*
String
Unique identifier of a subscription.
Required

Responses


adAccountsSubscriptions/getById

Get lead ads subscription

Get a specific lead ads subscription record. - Only requests for the OWNER or ADMIN of the ad_account will be allowed. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/leads/subscriptions/{subscription_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/leads/subscriptions/{subscription_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadAdsApi;

import java.io.File;
import java.util.*;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String subscriptionId = subscriptionId_example; // String | Unique identifier of a subscription.

        try {
            AdAccountGetSubscriptionResponse result = apiInstance.adAccountsSubscriptions/getById(adAccountId, subscriptionId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/getById");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String subscriptionId = new String(); // String | Unique identifier of a subscription.

try {
    final result = await api_instance.adAccountsSubscriptions/getById(adAccountId, subscriptionId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccountsSubscriptions/getById: $e\n');
}

import org.openapitools.client.api.LeadAdsApi;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String subscriptionId = subscriptionId_example; // String | Unique identifier of a subscription.

        try {
            AdAccountGetSubscriptionResponse result = apiInstance.adAccountsSubscriptions/getById(adAccountId, subscriptionId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/getById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadAdsApi *apiInstance = [[LeadAdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *subscriptionId = subscriptionId_example; // Unique identifier of a subscription. (default to null)

// Get lead ads subscription
[apiInstance adAccountsSubscriptions/getByIdWith:adAccountId
    subscriptionId:subscriptionId
              completionHandler: ^(AdAccountGetSubscriptionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadAdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var subscriptionId = subscriptionId_example; // {String} Unique identifier of a subscription.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccountsSubscriptions/getById(adAccountId, subscriptionId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountsSubscriptions/getByIdExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadAdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var subscriptionId = subscriptionId_example;  // String | Unique identifier of a subscription. (default to null)

            try {
                // Get lead ads subscription
                AdAccountGetSubscriptionResponse result = apiInstance.adAccountsSubscriptions/getById(adAccountId, subscriptionId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadAdsApi.adAccountsSubscriptions/getById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadAdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$subscriptionId = subscriptionId_example; // String | Unique identifier of a subscription.

try {
    $result = $api_instance->adAccountsSubscriptions/getById($adAccountId, $subscriptionId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LeadAdsApi->adAccountsSubscriptions/getById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadAdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadAdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $subscriptionId = subscriptionId_example; # String | Unique identifier of a subscription.

eval {
    my $result = $api_instance->adAccountsSubscriptions/getById(adAccountId => $adAccountId, subscriptionId => $subscriptionId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling LeadAdsApi->adAccountsSubscriptions/getById: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadAdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
subscriptionId = subscriptionId_example # String | Unique identifier of a subscription. (default to null)

try:
    # Get lead ads subscription
    api_response = api_instance.ad_accounts_subscriptions/get_by_id(adAccountId, subscriptionId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling LeadAdsApi->adAccountsSubscriptions/getById: %s\n" % e)
extern crate LeadAdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let subscriptionId = subscriptionId_example; // String

    let mut context = LeadAdsApi::Context::default();
    let result = client.adAccountsSubscriptions/getById(adAccountId, subscriptionId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
subscription_id*
String
Unique identifier of a subscription.
Required

Responses


adAccountsSubscriptions/getList

Get lead ads subscriptions

Get the advertiser's list of lead ads subscriptions. - Only requests for the OWNER or ADMIN of the ad_account will be allowed. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/leads/subscriptions

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/leads/subscriptions?page_size=56&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadAdsApi;

import java.io.File;
import java.util.*;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            ad_accounts_subscriptions_get_list_200_response result = apiInstance.adAccountsSubscriptions/getList(adAccountId, pageSize, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/getList");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.adAccountsSubscriptions/getList(adAccountId, pageSize, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccountsSubscriptions/getList: $e\n');
}

import org.openapitools.client.api.LeadAdsApi;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            ad_accounts_subscriptions_get_list_200_response result = apiInstance.adAccountsSubscriptions/getList(adAccountId, pageSize, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/getList");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadAdsApi *apiInstance = [[LeadAdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get lead ads subscriptions
[apiInstance adAccountsSubscriptions/getListWith:adAccountId
    pageSize:pageSize
    bookmark:bookmark
              completionHandler: ^(ad_accounts_subscriptions_get_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadAdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccountsSubscriptions/getList(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountsSubscriptions/getListExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadAdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get lead ads subscriptions
                ad_accounts_subscriptions_get_list_200_response result = apiInstance.adAccountsSubscriptions/getList(adAccountId, pageSize, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadAdsApi.adAccountsSubscriptions/getList: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadAdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->adAccountsSubscriptions/getList($adAccountId, $pageSize, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LeadAdsApi->adAccountsSubscriptions/getList: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadAdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadAdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->adAccountsSubscriptions/getList(adAccountId => $adAccountId, pageSize => $pageSize, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling LeadAdsApi->adAccountsSubscriptions/getList: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadAdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get lead ads subscriptions
    api_response = api_instance.ad_accounts_subscriptions/get_list(adAccountId, pageSize=pageSize, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling LeadAdsApi->adAccountsSubscriptions/getList: %s\n" % e)
extern crate LeadAdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pageSize = 56; // Integer
    let bookmark = bookmark_example; // String

    let mut context = LeadAdsApi::Context::default();
    let result = client.adAccountsSubscriptions/getList(adAccountId, pageSize, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
bookmark
String
Cursor used to fetch the next page of items

Responses


adAccountsSubscriptions/post

Create lead ads subscription

Create a lead ads webhook subscription. - Only requests for the OWNER or ADMIN of the ad_account will be allowed. - Advertisers can set up multiple integrations using ad_account_id + lead_form_id but only one integration per unique records. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/leads/subscriptions

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/leads/subscriptions" \
 -d '{
  "webhook_url" : "https://webhook.example.com/xyz",
  "lead_form_id" : "383791336903426390"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadAdsApi;

import java.io.File;
import java.util.*;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdAccountCreateSubscriptionRequest adAccountCreateSubscriptionRequest = ; // AdAccountCreateSubscriptionRequest | 

        try {
            AdAccountCreateSubscriptionResponse result = apiInstance.adAccountsSubscriptions/post(adAccountId, adAccountCreateSubscriptionRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/post");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final AdAccountCreateSubscriptionRequest adAccountCreateSubscriptionRequest = new AdAccountCreateSubscriptionRequest(); // AdAccountCreateSubscriptionRequest | 

try {
    final result = await api_instance.adAccountsSubscriptions/post(adAccountId, adAccountCreateSubscriptionRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccountsSubscriptions/post: $e\n');
}

import org.openapitools.client.api.LeadAdsApi;

public class LeadAdsApiExample {
    public static void main(String[] args) {
        LeadAdsApi apiInstance = new LeadAdsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        AdAccountCreateSubscriptionRequest adAccountCreateSubscriptionRequest = ; // AdAccountCreateSubscriptionRequest | 

        try {
            AdAccountCreateSubscriptionResponse result = apiInstance.adAccountsSubscriptions/post(adAccountId, adAccountCreateSubscriptionRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadAdsApi#adAccountsSubscriptions/post");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadAdsApi *apiInstance = [[LeadAdsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
AdAccountCreateSubscriptionRequest *adAccountCreateSubscriptionRequest = ; // 

// Create lead ads subscription
[apiInstance adAccountsSubscriptions/postWith:adAccountId
    adAccountCreateSubscriptionRequest:adAccountCreateSubscriptionRequest
              completionHandler: ^(AdAccountCreateSubscriptionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadAdsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var adAccountCreateSubscriptionRequest = ; // {AdAccountCreateSubscriptionRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccountsSubscriptions/post(adAccountId, adAccountCreateSubscriptionRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountsSubscriptions/postExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadAdsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var adAccountCreateSubscriptionRequest = new AdAccountCreateSubscriptionRequest(); // AdAccountCreateSubscriptionRequest | 

            try {
                // Create lead ads subscription
                AdAccountCreateSubscriptionResponse result = apiInstance.adAccountsSubscriptions/post(adAccountId, adAccountCreateSubscriptionRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadAdsApi.adAccountsSubscriptions/post: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadAdsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$adAccountCreateSubscriptionRequest = ; // AdAccountCreateSubscriptionRequest | 

try {
    $result = $api_instance->adAccountsSubscriptions/post($adAccountId, $adAccountCreateSubscriptionRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LeadAdsApi->adAccountsSubscriptions/post: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadAdsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadAdsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $adAccountCreateSubscriptionRequest = WWW::OPenAPIClient::Object::AdAccountCreateSubscriptionRequest->new(); # AdAccountCreateSubscriptionRequest | 

eval {
    my $result = $api_instance->adAccountsSubscriptions/post(adAccountId => $adAccountId, adAccountCreateSubscriptionRequest => $adAccountCreateSubscriptionRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling LeadAdsApi->adAccountsSubscriptions/post: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadAdsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
adAccountCreateSubscriptionRequest =  # AdAccountCreateSubscriptionRequest | 

try:
    # Create lead ads subscription
    api_response = api_instance.ad_accounts_subscriptions/post(adAccountId, adAccountCreateSubscriptionRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling LeadAdsApi->adAccountsSubscriptions/post: %s\n" % e)
extern crate LeadAdsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let adAccountCreateSubscriptionRequest = ; // AdAccountCreateSubscriptionRequest

    let mut context = LeadAdsApi::Context::default();
    let result = client.adAccountsSubscriptions/post(adAccountId, adAccountCreateSubscriptionRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
adAccountCreateSubscriptionRequest *

Subscription to create.

Responses


LeadForms

leadForm/get

Get lead form by id

Gets a lead form given it's ID. It must also be associated with the provided ad account ID. Retrieving an advertiser's lead form will only contain results if you're a part of the Lead ads beta. If you're interested in joining the beta, please reach out to your Pinterest account manager.


/ad_accounts/{ad_account_id}/lead_forms/{lead_form_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/lead_forms/{lead_form_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadFormsApi;

import java.io.File;
import java.util.*;

public class LeadFormsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadFormsApi apiInstance = new LeadFormsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String leadFormId = 1234567890123; // String | Unique identifier of a lead form.

        try {
            LeadFormResponse result = apiInstance.leadForm/get(adAccountId, leadFormId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadFormsApi#leadForm/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String leadFormId = new String(); // String | Unique identifier of a lead form.

try {
    final result = await api_instance.leadForm/get(adAccountId, leadFormId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->leadForm/get: $e\n');
}

import org.openapitools.client.api.LeadFormsApi;

public class LeadFormsApiExample {
    public static void main(String[] args) {
        LeadFormsApi apiInstance = new LeadFormsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String leadFormId = 1234567890123; // String | Unique identifier of a lead form.

        try {
            LeadFormResponse result = apiInstance.leadForm/get(adAccountId, leadFormId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadFormsApi#leadForm/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadFormsApi *apiInstance = [[LeadFormsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *leadFormId = 1234567890123; // Unique identifier of a lead form. (default to null)

// Get lead form by id
[apiInstance leadForm/getWith:adAccountId
    leadFormId:leadFormId
              completionHandler: ^(LeadFormResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadFormsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var leadFormId = 1234567890123; // {String} Unique identifier of a lead form.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.leadForm/get(adAccountId, leadFormId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class leadForm/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadFormsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var leadFormId = 1234567890123;  // String | Unique identifier of a lead form. (default to null)

            try {
                // Get lead form by id
                LeadFormResponse result = apiInstance.leadForm/get(adAccountId, leadFormId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadFormsApi.leadForm/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadFormsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$leadFormId = 1234567890123; // String | Unique identifier of a lead form.

try {
    $result = $api_instance->leadForm/get($adAccountId, $leadFormId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LeadFormsApi->leadForm/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadFormsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadFormsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $leadFormId = 1234567890123; # String | Unique identifier of a lead form.

eval {
    my $result = $api_instance->leadForm/get(adAccountId => $adAccountId, leadFormId => $leadFormId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling LeadFormsApi->leadForm/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadFormsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
leadFormId = 1234567890123 # String | Unique identifier of a lead form. (default to null)

try:
    # Get lead form by id
    api_response = api_instance.lead_form/get(adAccountId, leadFormId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling LeadFormsApi->leadForm/get: %s\n" % e)
extern crate LeadFormsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let leadFormId = 1234567890123; // String

    let mut context = LeadFormsApi::Context::default();
    let result = client.leadForm/get(adAccountId, leadFormId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
lead_form_id*
String
Unique identifier of a lead form.
Required

Responses


leadFormTest/create

Create lead form test data

Create lead form test data based on the list of answers provided as part of the body. - List of answers should follow the questions creation order. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/ad_accounts/{ad_account_id}/lead_forms/{lead_form_id}/test

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/lead_forms/{lead_form_id}/test" \
 -d '{
  "answers" : [ "John", "Doe", "abc@email.com", "987654321" ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadFormsApi;

import java.io.File;
import java.util.*;

public class LeadFormsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadFormsApi apiInstance = new LeadFormsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String leadFormId = 1234567890123; // String | Unique identifier of a lead form.
        LeadFormTestRequest leadFormTestRequest = ; // LeadFormTestRequest | 

        try {
            LeadFormTestResponse result = apiInstance.leadFormTest/create(adAccountId, leadFormId, leadFormTestRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadFormsApi#leadFormTest/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String leadFormId = new String(); // String | Unique identifier of a lead form.
final LeadFormTestRequest leadFormTestRequest = new LeadFormTestRequest(); // LeadFormTestRequest | 

try {
    final result = await api_instance.leadFormTest/create(adAccountId, leadFormId, leadFormTestRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->leadFormTest/create: $e\n');
}

import org.openapitools.client.api.LeadFormsApi;

public class LeadFormsApiExample {
    public static void main(String[] args) {
        LeadFormsApi apiInstance = new LeadFormsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String leadFormId = 1234567890123; // String | Unique identifier of a lead form.
        LeadFormTestRequest leadFormTestRequest = ; // LeadFormTestRequest | 

        try {
            LeadFormTestResponse result = apiInstance.leadFormTest/create(adAccountId, leadFormId, leadFormTestRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadFormsApi#leadFormTest/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadFormsApi *apiInstance = [[LeadFormsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *leadFormId = 1234567890123; // Unique identifier of a lead form. (default to null)
LeadFormTestRequest *leadFormTestRequest = ; // 

// Create lead form test data
[apiInstance leadFormTest/createWith:adAccountId
    leadFormId:leadFormId
    leadFormTestRequest:leadFormTestRequest
              completionHandler: ^(LeadFormTestResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadFormsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var leadFormId = 1234567890123; // {String} Unique identifier of a lead form.
var leadFormTestRequest = ; // {LeadFormTestRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.leadFormTest/create(adAccountId, leadFormId, leadFormTestRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class leadFormTest/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadFormsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var leadFormId = 1234567890123;  // String | Unique identifier of a lead form. (default to null)
            var leadFormTestRequest = new LeadFormTestRequest(); // LeadFormTestRequest | 

            try {
                // Create lead form test data
                LeadFormTestResponse result = apiInstance.leadFormTest/create(adAccountId, leadFormId, leadFormTestRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadFormsApi.leadFormTest/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadFormsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$leadFormId = 1234567890123; // String | Unique identifier of a lead form.
$leadFormTestRequest = ; // LeadFormTestRequest | 

try {
    $result = $api_instance->leadFormTest/create($adAccountId, $leadFormId, $leadFormTestRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LeadFormsApi->leadFormTest/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadFormsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadFormsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $leadFormId = 1234567890123; # String | Unique identifier of a lead form.
my $leadFormTestRequest = WWW::OPenAPIClient::Object::LeadFormTestRequest->new(); # LeadFormTestRequest | 

eval {
    my $result = $api_instance->leadFormTest/create(adAccountId => $adAccountId, leadFormId => $leadFormId, leadFormTestRequest => $leadFormTestRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling LeadFormsApi->leadFormTest/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadFormsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
leadFormId = 1234567890123 # String | Unique identifier of a lead form. (default to null)
leadFormTestRequest =  # LeadFormTestRequest | 

try:
    # Create lead form test data
    api_response = api_instance.lead_form_test/create(adAccountId, leadFormId, leadFormTestRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling LeadFormsApi->leadFormTest/create: %s\n" % e)
extern crate LeadFormsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let leadFormId = 1234567890123; // String
    let leadFormTestRequest = ; // LeadFormTestRequest

    let mut context = LeadFormsApi::Context::default();
    let result = client.leadFormTest/create(adAccountId, leadFormId, leadFormTestRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
lead_form_id*
String
Unique identifier of a lead form.
Required
Body parameters
Name Description
leadFormTestRequest *

Subscription to create.

Responses


leadForms/list

Get lead forms

Gets all Lead Forms associated with an ad account ID. Retrieving an advertiser's list of lead forms will only contain results if you're a part of the Lead ads beta. If you're interested in joining the beta, please reach out to your Pinterest account manager.


/ad_accounts/{ad_account_id}/lead_forms

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/lead_forms?page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.LeadFormsApi;

import java.io.File;
import java.util.*;

public class LeadFormsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        LeadFormsApi apiInstance = new LeadFormsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            lead_forms_list_200_response result = apiInstance.leadForms/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadFormsApi#leadForms/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.leadForms/list(adAccountId, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->leadForms/list: $e\n');
}

import org.openapitools.client.api.LeadFormsApi;

public class LeadFormsApiExample {
    public static void main(String[] args) {
        LeadFormsApi apiInstance = new LeadFormsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            lead_forms_list_200_response result = apiInstance.leadForms/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling LeadFormsApi#leadForms/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
LeadFormsApi *apiInstance = [[LeadFormsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get lead forms
[apiInstance leadForms/listWith:adAccountId
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(lead_forms_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.LeadFormsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.leadForms/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class leadForms/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new LeadFormsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get lead forms
                lead_forms_list_200_response result = apiInstance.leadForms/list(adAccountId, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling LeadFormsApi.leadForms/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\LeadFormsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->leadForms/list($adAccountId, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LeadFormsApi->leadForms/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::LeadFormsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::LeadFormsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->leadForms/list(adAccountId => $adAccountId, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling LeadFormsApi->leadForms/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.LeadFormsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get lead forms
    api_response = api_instance.lead_forms/list(adAccountId, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling LeadFormsApi->leadForms/list: %s\n" % e)
extern crate LeadFormsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = LeadFormsApi::Context::default();
    let result = client.leadForms/list(adAccountId, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


Media

media/create

Register media upload

Register your intent to upload media The response includes all of the information needed to upload the media to Pinterest. To upload the media, make an HTTP POST request (using <tt>curl</tt>, for example) to <tt>upload_url</tt> using the <tt>Content-Type</tt> header value. Send the media file's contents as the request's <tt>file</tt> parameter and also include all of the parameters from <tt>upload_parameters</tt>. <strong><a href='/docs/content/content-creation/#Creating%20video%20Pins'>Learn more</a></strong> about video Pin creation.


/media

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/media" \
 -d '{
  "media_type" : "video"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.MediaApi;

import java.io.File;
import java.util.*;

public class MediaApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        MediaApi apiInstance = new MediaApi();
        MediaUploadRequest mediaUploadRequest = ; // MediaUploadRequest | 

        try {
            MediaUpload result = apiInstance.media/create(mediaUploadRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MediaApi#media/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final MediaUploadRequest mediaUploadRequest = new MediaUploadRequest(); // MediaUploadRequest | 

try {
    final result = await api_instance.media/create(mediaUploadRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->media/create: $e\n');
}

import org.openapitools.client.api.MediaApi;

public class MediaApiExample {
    public static void main(String[] args) {
        MediaApi apiInstance = new MediaApi();
        MediaUploadRequest mediaUploadRequest = ; // MediaUploadRequest | 

        try {
            MediaUpload result = apiInstance.media/create(mediaUploadRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MediaApi#media/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
MediaApi *apiInstance = [[MediaApi alloc] init];
MediaUploadRequest *mediaUploadRequest = ; // 

// Register media upload
[apiInstance media/createWith:mediaUploadRequest
              completionHandler: ^(MediaUpload output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.MediaApi()
var mediaUploadRequest = ; // {MediaUploadRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.media/create(mediaUploadRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class media/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new MediaApi();
            var mediaUploadRequest = new MediaUploadRequest(); // MediaUploadRequest | 

            try {
                // Register media upload
                MediaUpload result = apiInstance.media/create(mediaUploadRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling MediaApi.media/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\MediaApi();
$mediaUploadRequest = ; // MediaUploadRequest | 

try {
    $result = $api_instance->media/create($mediaUploadRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MediaApi->media/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::MediaApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::MediaApi->new();
my $mediaUploadRequest = WWW::OPenAPIClient::Object::MediaUploadRequest->new(); # MediaUploadRequest | 

eval {
    my $result = $api_instance->media/create(mediaUploadRequest => $mediaUploadRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling MediaApi->media/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.MediaApi()
mediaUploadRequest =  # MediaUploadRequest | 

try:
    # Register media upload
    api_response = api_instance.media/create(mediaUploadRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MediaApi->media/create: %s\n" % e)
extern crate MediaApi;

pub fn main() {
    let mediaUploadRequest = ; // MediaUploadRequest

    let mut context = MediaApi::Context::default();
    let result = client.media/create(mediaUploadRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

pins:read See your public Pins
pins:write Create, update, or delete your public Pins

Parameters

Body parameters
Name Description
mediaUploadRequest *

Create a media upload request

Responses


media/get

Get media upload details

Get details for a registered media upload, including its current status. <strong><a href='/docs/content/content-creation/#Creating%20video%20Pins'>Learn more</a></strong> about video Pin creation.


/media/{media_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/media/{media_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.MediaApi;

import java.io.File;
import java.util.*;

public class MediaApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        MediaApi apiInstance = new MediaApi();
        String mediaId = mediaId_example; // String | Media identifier

        try {
            MediaUploadDetails result = apiInstance.media/get(mediaId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MediaApi#media/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String mediaId = new String(); // String | Media identifier

try {
    final result = await api_instance.media/get(mediaId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->media/get: $e\n');
}

import org.openapitools.client.api.MediaApi;

public class MediaApiExample {
    public static void main(String[] args) {
        MediaApi apiInstance = new MediaApi();
        String mediaId = mediaId_example; // String | Media identifier

        try {
            MediaUploadDetails result = apiInstance.media/get(mediaId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MediaApi#media/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
MediaApi *apiInstance = [[MediaApi alloc] init];
String *mediaId = mediaId_example; // Media identifier (default to null)

// Get media upload details
[apiInstance media/getWith:mediaId
              completionHandler: ^(MediaUploadDetails output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.MediaApi()
var mediaId = mediaId_example; // {String} Media identifier

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.media/get(mediaId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class media/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new MediaApi();
            var mediaId = mediaId_example;  // String | Media identifier (default to null)

            try {
                // Get media upload details
                MediaUploadDetails result = apiInstance.media/get(mediaId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling MediaApi.media/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\MediaApi();
$mediaId = mediaId_example; // String | Media identifier

try {
    $result = $api_instance->media/get($mediaId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MediaApi->media/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::MediaApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::MediaApi->new();
my $mediaId = mediaId_example; # String | Media identifier

eval {
    my $result = $api_instance->media/get(mediaId => $mediaId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling MediaApi->media/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.MediaApi()
mediaId = mediaId_example # String | Media identifier (default to null)

try:
    # Get media upload details
    api_response = api_instance.media/get(mediaId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MediaApi->media/get: %s\n" % e)
extern crate MediaApi;

pub fn main() {
    let mediaId = mediaId_example; // String

    let mut context = MediaApi::Context::default();
    let result = client.media/get(mediaId, &context).wait();

    println!("{:?}", result);
}

Scopes

pins:read See your public Pins

Parameters

Path parameters
Name Description
media_id*
String
Media identifier
Required

Responses


media/list

List media uploads

List media uploads filtered by given parameters. <strong><a href='/docs/content/content-creation/#Creating%20video%20Pins'>Learn more</a></strong> about video Pin creation.


/media

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/media?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.MediaApi;

import java.io.File;
import java.util.*;

public class MediaApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        MediaApi apiInstance = new MediaApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            media_list_200_response result = apiInstance.media/list(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MediaApi#media/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.media/list(bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->media/list: $e\n');
}

import org.openapitools.client.api.MediaApi;

public class MediaApiExample {
    public static void main(String[] args) {
        MediaApi apiInstance = new MediaApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            media_list_200_response result = apiInstance.media/list(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MediaApi#media/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
MediaApi *apiInstance = [[MediaApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// List media uploads
[apiInstance media/listWith:bookmark
    pageSize:pageSize
              completionHandler: ^(media_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.MediaApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.media/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class media/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new MediaApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // List media uploads
                media_list_200_response result = apiInstance.media/list(bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling MediaApi.media/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\MediaApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->media/list($bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MediaApi->media/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::MediaApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::MediaApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->media/list(bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling MediaApi->media/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.MediaApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # List media uploads
    api_response = api_instance.media/list(bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MediaApi->media/list: %s\n" % e)
extern crate MediaApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = MediaApi::Context::default();
    let result = client.media/list(bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

pins:read See your public Pins

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


Oauth

oauth/token

Generate OAuth access token

Generate an OAuth access token by using an authorization code or a refresh token. IMPORTANT: You need to start the OAuth flow via www.pinterest.com/oauth before calling this endpoint (or have an existing refresh token). See <a href='/docs/getting-started/authentication/'>Authentication</a> for more. <strong>Parameter <i>refresh_on</i> and its corresponding response type <i>everlasting_refresh</i> are now available to all apps! Later this year, continuous refresh will become the default behavior (ie you will no longer need to send this parameter). <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/oauth/token

Usage and SDK Samples

curl -X POST \
 -H "Authorization: Basic [[basicHash]]" \
 -H "Accept: application/json" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 "https://api.pinterest.com/v5/oauth/token"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.OauthApi;

import java.io.File;
import java.util.*;

public class OauthApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basic
        HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
        basic.setUsername("YOUR USERNAME");
        basic.setPassword("YOUR PASSWORD");

        // Create an instance of the API class
        OauthApi apiInstance = new OauthApi();
        String grantType = grantType_example; // String | 

        try {
            OauthAccessTokenResponse result = apiInstance.oauth/token(grantType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OauthApi#oauth/token");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String grantType = new String(); // String | 

try {
    final result = await api_instance.oauth/token(grantType);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->oauth/token: $e\n');
}

import org.openapitools.client.api.OauthApi;

public class OauthApiExample {
    public static void main(String[] args) {
        OauthApi apiInstance = new OauthApi();
        String grantType = grantType_example; // String | 

        try {
            OauthAccessTokenResponse result = apiInstance.oauth/token(grantType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OauthApi#oauth/token");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basic)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

// Create an instance of the API class
OauthApi *apiInstance = [[OauthApi alloc] init];
String *grantType = grantType_example; //  (default to null)

// Generate OAuth access token
[apiInstance oauth/tokenWith:grantType
              completionHandler: ^(OauthAccessTokenResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

// Create an instance of the API class
var api = new PinterestRestApi.OauthApi()
var grantType = grantType_example; // {String} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.oauth/token(grantType, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class oauth/tokenExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basic
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";

            // Create an instance of the API class
            var apiInstance = new OauthApi();
            var grantType = grantType_example;  // String |  (default to null)

            try {
                // Generate OAuth access token
                OauthAccessTokenResponse result = apiInstance.oauth/token(grantType);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling OauthApi.oauth/token: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basic
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\OauthApi();
$grantType = grantType_example; // String | 

try {
    $result = $api_instance->oauth/token($grantType);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OauthApi->oauth/token: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::OauthApi;
# Configure HTTP basic authorization: basic
$WWW::OPenAPIClient::Configuration::username = 'YOUR_USERNAME';
$WWW::OPenAPIClient::Configuration::password = 'YOUR_PASSWORD';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::OauthApi->new();
my $grantType = grantType_example; # String | 

eval {
    my $result = $api_instance->oauth/token(grantType => $grantType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OauthApi->oauth/token: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
openapi_client.configuration.username = 'YOUR_USERNAME'
openapi_client.configuration.password = 'YOUR_PASSWORD'

# Create an instance of the API class
api_instance = openapi_client.OauthApi()
grantType = grantType_example # String |  (default to null)

try:
    # Generate OAuth access token
    api_response = api_instance.oauth/token(grantType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OauthApi->oauth/token: %s\n" % e)
extern crate OauthApi;

pub fn main() {
    let grantType = grantType_example; // String

    let mut context = OauthApi::Context::default();
    let result = client.oauth/token(grantType, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Form parameters
Name Description
grant_type*
String
Enum: authorization_code, refresh_token
Required

Responses


OrderLines

orderLines/get

Get order line

Get a specific existing order line associated with an ad account.


/ad_accounts/{ad_account_id}/order_lines/{order_line_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/order_lines/{order_line_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.OrderLinesApi;

import java.io.File;
import java.util.*;

public class OrderLinesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        OrderLinesApi apiInstance = new OrderLinesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String orderLineId = orderLineId_example; // String | Unique identifier of an order line.

        try {
            OrderLine result = apiInstance.orderLines/get(adAccountId, orderLineId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrderLinesApi#orderLines/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String orderLineId = new String(); // String | Unique identifier of an order line.

try {
    final result = await api_instance.orderLines/get(adAccountId, orderLineId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->orderLines/get: $e\n');
}

import org.openapitools.client.api.OrderLinesApi;

public class OrderLinesApiExample {
    public static void main(String[] args) {
        OrderLinesApi apiInstance = new OrderLinesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String orderLineId = orderLineId_example; // String | Unique identifier of an order line.

        try {
            OrderLine result = apiInstance.orderLines/get(adAccountId, orderLineId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrderLinesApi#orderLines/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
OrderLinesApi *apiInstance = [[OrderLinesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *orderLineId = orderLineId_example; // Unique identifier of an order line. (default to null)

// Get order line
[apiInstance orderLines/getWith:adAccountId
    orderLineId:orderLineId
              completionHandler: ^(OrderLine output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.OrderLinesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var orderLineId = orderLineId_example; // {String} Unique identifier of an order line.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.orderLines/get(adAccountId, orderLineId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class orderLines/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new OrderLinesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var orderLineId = orderLineId_example;  // String | Unique identifier of an order line. (default to null)

            try {
                // Get order line
                OrderLine result = apiInstance.orderLines/get(adAccountId, orderLineId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling OrderLinesApi.orderLines/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\OrderLinesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$orderLineId = orderLineId_example; // String | Unique identifier of an order line.

try {
    $result = $api_instance->orderLines/get($adAccountId, $orderLineId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderLinesApi->orderLines/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::OrderLinesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::OrderLinesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $orderLineId = orderLineId_example; # String | Unique identifier of an order line.

eval {
    my $result = $api_instance->orderLines/get(adAccountId => $adAccountId, orderLineId => $orderLineId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OrderLinesApi->orderLines/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.OrderLinesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
orderLineId = orderLineId_example # String | Unique identifier of an order line. (default to null)

try:
    # Get order line
    api_response = api_instance.order_lines/get(adAccountId, orderLineId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OrderLinesApi->orderLines/get: %s\n" % e)
extern crate OrderLinesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let orderLineId = orderLineId_example; // String

    let mut context = OrderLinesApi::Context::default();
    let result = client.orderLines/get(adAccountId, orderLineId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
order_line_id*
String
Unique identifier of an order line.
Required

Responses


orderLines/list

Get order lines

List existing order lines associated with an ad account.


/ad_accounts/{ad_account_id}/order_lines

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/order_lines?page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.OrderLinesApi;

import java.io.File;
import java.util.*;

public class OrderLinesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        OrderLinesApi apiInstance = new OrderLinesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            order_lines_list_200_response result = apiInstance.orderLines/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrderLinesApi#orderLines/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.orderLines/list(adAccountId, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->orderLines/list: $e\n');
}

import org.openapitools.client.api.OrderLinesApi;

public class OrderLinesApiExample {
    public static void main(String[] args) {
        OrderLinesApi apiInstance = new OrderLinesApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            order_lines_list_200_response result = apiInstance.orderLines/list(adAccountId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling OrderLinesApi#orderLines/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
OrderLinesApi *apiInstance = [[OrderLinesApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get order lines
[apiInstance orderLines/listWith:adAccountId
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(order_lines_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.OrderLinesApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.orderLines/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class orderLines/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new OrderLinesApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get order lines
                order_lines_list_200_response result = apiInstance.orderLines/list(adAccountId, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling OrderLinesApi.orderLines/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\OrderLinesApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->orderLines/list($adAccountId, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderLinesApi->orderLines/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::OrderLinesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::OrderLinesApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->orderLines/list(adAccountId => $adAccountId, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling OrderLinesApi->orderLines/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.OrderLinesApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get order lines
    api_response = api_instance.order_lines/list(adAccountId, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling OrderLinesApi->orderLines/list: %s\n" % e)
extern crate OrderLinesApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = OrderLinesApi::Context::default();
    let result = client.orderLines/list(adAccountId, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


Pins

pins/analytics

Get Pin analytics

Get analytics for a Pin owned by the "operation user_account" - or on a group board that has been shared with this account. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href="https://developers.pinterest.com/docs/api/v5/#operation/ad_accounts/list">List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: - For Pins on public or protected boards: Admin, Analyst. - For Pins on secret boards: Admin. If Pin was created before <code>2023-03-20</code> lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.


/pins/{pin_id}/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/pins/{pin_id}/analytics?start_date=2013-10-20&end_date=2013-10-20&app_types=appTypes_example&metric_types=&split_field=splitField_example&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[pins_analytics_metric_types_parameter_inner] metricTypes = ; // array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String splitField = splitField_example; // String | How to split the data into groups. Not including this param means data won't be split.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            map['String', PinAnalyticsMetricsResponse] result = apiInstance.pins/analytics(pinId, startDate, endDate, metricTypes, appTypes, splitField, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/analytics");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String pinId = new String(); // String | Unique identifier of a Pin.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[pins_analytics_metric_types_parameter_inner] metricTypes = new array[pins_analytics_metric_types_parameter_inner](); // array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all.
final String appTypes = new String(); // String | Apps or devices to get data for, default is all.
final String splitField = new String(); // String | How to split the data into groups. Not including this param means data won't be split.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.pins/analytics(pinId, startDate, endDate, metricTypes, appTypes, splitField, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pins/analytics: $e\n');
}

import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[pins_analytics_metric_types_parameter_inner] metricTypes = ; // array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String splitField = splitField_example; // String | How to split the data into groups. Not including this param means data won't be split.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            map['String', PinAnalyticsMetricsResponse] result = apiInstance.pins/analytics(pinId, startDate, endDate, metricTypes, appTypes, splitField, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/analytics");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
String *pinId = pinId_example; // Unique identifier of a Pin. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[pins_analytics_metric_types_parameter_inner] *metricTypes = ; // Pin metric types to get data for, default is all. (default to null)
String *appTypes = appTypes_example; // Apps or devices to get data for, default is all. (optional) (default to ALL)
String *splitField = splitField_example; // How to split the data into groups. Not including this param means data won't be split. (optional) (default to NO_SPLIT)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get Pin analytics
[apiInstance pins/analyticsWith:pinId
    startDate:startDate
    endDate:endDate
    metricTypes:metricTypes
    appTypes:appTypes
    splitField:splitField
    adAccountId:adAccountId
              completionHandler: ^(map['String', PinAnalyticsMetricsResponse] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var pinId = pinId_example; // {String} Unique identifier of a Pin.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var metricTypes = ; // {array[pins_analytics_metric_types_parameter_inner]} Pin metric types to get data for, default is all.
var opts = {
  'appTypes': appTypes_example, // {String} Apps or devices to get data for, default is all.
  'splitField': splitField_example, // {String} How to split the data into groups. Not including this param means data won't be split.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.pins/analytics(pinId, startDate, endDate, metricTypes, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var pinId = pinId_example;  // String | Unique identifier of a Pin. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var metricTypes = new array[pins_analytics_metric_types_parameter_inner](); // array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all. (default to null)
            var appTypes = appTypes_example;  // String | Apps or devices to get data for, default is all. (optional)  (default to ALL)
            var splitField = splitField_example;  // String | How to split the data into groups. Not including this param means data won't be split. (optional)  (default to NO_SPLIT)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get Pin analytics
                map['String', PinAnalyticsMetricsResponse] result = apiInstance.pins/analytics(pinId, startDate, endDate, metricTypes, appTypes, splitField, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PinsApi.pins/analytics: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$pinId = pinId_example; // String | Unique identifier of a Pin.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$metricTypes = ; // array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all.
$appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
$splitField = splitField_example; // String | How to split the data into groups. Not including this param means data won't be split.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->pins/analytics($pinId, $startDate, $endDate, $metricTypes, $appTypes, $splitField, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PinsApi->pins/analytics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $pinId = pinId_example; # String | Unique identifier of a Pin.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $metricTypes = []; # array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all.
my $appTypes = appTypes_example; # String | Apps or devices to get data for, default is all.
my $splitField = splitField_example; # String | How to split the data into groups. Not including this param means data won't be split.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->pins/analytics(pinId => $pinId, startDate => $startDate, endDate => $endDate, metricTypes => $metricTypes, appTypes => $appTypes, splitField => $splitField, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PinsApi->pins/analytics: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
pinId = pinId_example # String | Unique identifier of a Pin. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
metricTypes =  # array[pins_analytics_metric_types_parameter_inner] | Pin metric types to get data for, default is all. (default to null)
appTypes = appTypes_example # String | Apps or devices to get data for, default is all. (optional) (default to ALL)
splitField = splitField_example # String | How to split the data into groups. Not including this param means data won't be split. (optional) (default to NO_SPLIT)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get Pin analytics
    api_response = api_instance.pins/analytics(pinId, startDate, endDate, metricTypes, appTypes=appTypes, splitField=splitField, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PinsApi->pins/analytics: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let pinId = pinId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let metricTypes = ; // array[pins_analytics_metric_types_parameter_inner]
    let appTypes = appTypes_example; // String
    let splitField = splitField_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = PinsApi::Context::default();
    let result = client.pins/analytics(pinId, startDate, endDate, metricTypes, appTypes, splitField, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
pins:read See your public Pins

Parameters

Path parameters
Name Description
pin_id*
String
Unique identifier of a Pin.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
app_types
String
Apps or devices to get data for, default is all.
metric_types*
array[pins_analytics_metric_types_parameter_inner]
Pin metric types to get data for, default is all.
Required
split_field
String
How to split the data into groups. Not including this param means data won't be split.
ad_account_id
String
Unique identifier of an ad account.

Responses


pins/create

Create Pin

Create a Pin on a board or board section owned by the "operation user_account". Note: If the current "operation user_account" (defined by the access token) has access to another user's Ad Accounts via Pinterest Business Access, you can modify your request to make use of the current operation_user_account's permissions to those Ad Accounts by including the ad_account_id in the path parameters for the request (e.g. .../?ad_account_id=12345&...). - This function is intended solely for publishing new content created by the user. If you are interested in saving content created by others to your Pinterest boards, sometimes called 'curated content', please use our <a href='/docs/add-ons/save-button'>Save button</a> instead. For more tips on creating fresh content for Pinterest, review our <a href='/docs/content/content-creation/'>Content App Solutions Guide</a>. <strong><a href='/docs/content/content-creation/#Creating%20video%20Pins'>Learn more</a></strong> about video Pin creation.


/pins

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/pins?ad_account_id=adAccountId_example" \
 -d '{
  "note" : "note",
  "board_owner" : {
    "username" : "username"
  },
  "media_source" : "{}",
  "link" : "https://www.pinterest.com/",
  "created_at" : "2020-01-01T20:10:40Z",
  "description" : "description",
  "media" : {
    "media_type" : "media_type"
  },
  "title" : "title",
  "board_section_id" : "board_section_id",
  "dominant_color" : "#6E7874",
  "alt_text" : "alt_text",
  "board_id" : "board_id",
  "parent_pin_id" : "parent_pin_id",
  "id" : "813744226420795884"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        PinCreate pinCreate = ; // PinCreate | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/create(pinCreate, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final PinCreate pinCreate = new PinCreate(); // PinCreate | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.pins/create(pinCreate, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pins/create: $e\n');
}

import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        PinCreate pinCreate = ; // PinCreate | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/create(pinCreate, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
PinCreate *pinCreate = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Create Pin
[apiInstance pins/createWith:pinCreate
    adAccountId:adAccountId
              completionHandler: ^(Pin output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var pinCreate = ; // {PinCreate} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.pins/create(pinCreate, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var pinCreate = new PinCreate(); // PinCreate | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Create Pin
                Pin result = apiInstance.pins/create(pinCreate, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PinsApi.pins/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$pinCreate = ; // PinCreate | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->pins/create($pinCreate, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PinsApi->pins/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $pinCreate = WWW::OPenAPIClient::Object::PinCreate->new(); # PinCreate | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->pins/create(pinCreate => $pinCreate, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PinsApi->pins/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
pinCreate =  # PinCreate | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Create Pin
    api_response = api_instance.pins/create(pinCreate, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PinsApi->pins/create: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let pinCreate = ; // PinCreate
    let adAccountId = adAccountId_example; // String

    let mut context = PinsApi::Context::default();
    let result = client.pins/create(pinCreate, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards
pins:read See your public Pins
pins:write Create, update, or delete your public Pins

Parameters

Body parameters
Name Description
pinCreate *

Create a new Pin.

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


pins/delete

Delete Pin

Delete a Pins owned by the "operation user_account" - or on a group board that has been shared with this account. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: - For Pins on public or protected boards: Owner, Admin, Analyst, Campaign Manager. - For Pins on secret boards: Owner, Admin.


/pins/{pin_id}

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/pins/{pin_id}?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.pins/delete(pinId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String pinId = new String(); // String | Unique identifier of a Pin.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.pins/delete(pinId, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pins/delete: $e\n');
}

import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            apiInstance.pins/delete(pinId, adAccountId);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
String *pinId = pinId_example; // Unique identifier of a Pin. (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Delete Pin
[apiInstance pins/deleteWith:pinId
    adAccountId:adAccountId
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var pinId = pinId_example; // {String} Unique identifier of a Pin.
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.pins/delete(pinId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var pinId = pinId_example;  // String | Unique identifier of a Pin. (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Delete Pin
                apiInstance.pins/delete(pinId, adAccountId);
            } catch (Exception e) {
                Debug.Print("Exception when calling PinsApi.pins/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$pinId = pinId_example; // String | Unique identifier of a Pin.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $api_instance->pins/delete($pinId, $adAccountId);
} catch (Exception $e) {
    echo 'Exception when calling PinsApi->pins/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $pinId = pinId_example; # String | Unique identifier of a Pin.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    $api_instance->pins/delete(pinId => $pinId, adAccountId => $adAccountId);
};
if ($@) {
    warn "Exception when calling PinsApi->pins/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
pinId = pinId_example # String | Unique identifier of a Pin. (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Delete Pin
    api_instance.pins/delete(pinId, adAccountId=adAccountId)
except ApiException as e:
    print("Exception when calling PinsApi->pins/delete: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let pinId = pinId_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = PinsApi::Context::default();
    let result = client.pins/delete(pinId, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards
pins:read See your public Pins
pins:write Create, update, or delete your public Pins

Parameters

Path parameters
Name Description
pin_id*
String
Unique identifier of a Pin.
Required
Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


pins/get

Get Pin

Get a Pin owned by the "operation user_account" - or on a group board that has been shared with this account. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: - For Pins on public or protected boards: Owner, Admin, Analyst, Campaign Manager. - For Pins on secret boards: Owner, Admin.


/pins/{pin_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/pins/{pin_id}?pin_metrics=true&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        Boolean pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/get(pinId, pinMetrics, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String pinId = new String(); // String | Unique identifier of a Pin.
final Boolean pinMetrics = new Boolean(); // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.pins/get(pinId, pinMetrics, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pins/get: $e\n');
}

import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        Boolean pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/get(pinId, pinMetrics, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
String *pinId = pinId_example; // Unique identifier of a Pin. (default to null)
Boolean *pinMetrics = true; // Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get Pin
[apiInstance pins/getWith:pinId
    pinMetrics:pinMetrics
    adAccountId:adAccountId
              completionHandler: ^(Pin output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var pinId = pinId_example; // {String} Unique identifier of a Pin.
var opts = {
  'pinMetrics': true, // {Boolean} Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.pins/get(pinId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var pinId = pinId_example;  // String | Unique identifier of a Pin. (default to null)
            var pinMetrics = true;  // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional)  (default to false)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get Pin
                Pin result = apiInstance.pins/get(pinId, pinMetrics, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PinsApi.pins/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$pinId = pinId_example; // String | Unique identifier of a Pin.
$pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->pins/get($pinId, $pinMetrics, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PinsApi->pins/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $pinId = pinId_example; # String | Unique identifier of a Pin.
my $pinMetrics = true; # Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->pins/get(pinId => $pinId, pinMetrics => $pinMetrics, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PinsApi->pins/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
pinId = pinId_example # String | Unique identifier of a Pin. (default to null)
pinMetrics = true # Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get Pin
    api_response = api_instance.pins/get(pinId, pinMetrics=pinMetrics, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PinsApi->pins/get: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let pinId = pinId_example; // String
    let pinMetrics = true; // Boolean
    let adAccountId = adAccountId_example; // String

    let mut context = PinsApi::Context::default();
    let result = client.pins/get(pinId, pinMetrics, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
pins:read See your public Pins

Parameters

Path parameters
Name Description
pin_id*
String
Unique identifier of a Pin.
Required
Query parameters
Name Description
pin_metrics
Boolean
Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before <code>2023-03-20</code> lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.
ad_account_id
String
Unique identifier of an ad account.

Responses


pins/list

List Pins

Get a list of the Pins owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. - All Pins owned by the "operation user_account" are included, regardless of who owns the board they are on. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account".


/pins

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/pins?bookmark=bookmark_example&page_size=56&pin_filter=pinFilter_example&include_protected_pins=true&pin_type=pinType_example&creative_types=&ad_account_id=adAccountId_example&pin_metrics=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String pinFilter = pinFilter_example; // String | Pin filter.
        Boolean includeProtectedPins = true; // Boolean | Specify if return pins from protected boards
        String pinType = pinType_example; // String | The type of pins to return, currently only enabled for private pins
        array[String] creativeTypes = ; // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. String adAccountId = adAccountId_example; // String | Unique identifier of an ad account. Boolean pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { pins_list_200_response result = apiInstance.pins/list(bookmark, pageSize, pinFilter, includeProtectedPins, pinType, creativeTypes, adAccountId, pinMetrics); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PinsApi#pins/list"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String pinFilter = new String(); // String | Pin filter.
final Boolean includeProtectedPins = new Boolean(); // Boolean | Specify if return pins from protected boards
final String pinType = new String(); // String | The type of pins to return, currently only enabled for private pins
final array[String] creativeTypes = new array[String](); // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. final String adAccountId = new String(); // String | Unique identifier of an ad account. final Boolean pinMetrics = new Boolean(); // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { final result = await api_instance.pins/list(bookmark, pageSize, pinFilter, includeProtectedPins, pinType, creativeTypes, adAccountId, pinMetrics); print(result); } catch (e) { print('Exception when calling DefaultApi->pins/list: $e\n'); }
import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String pinFilter = pinFilter_example; // String | Pin filter.
        Boolean includeProtectedPins = true; // Boolean | Specify if return pins from protected boards
        String pinType = pinType_example; // String | The type of pins to return, currently only enabled for private pins
        array[String] creativeTypes = ; // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. String adAccountId = adAccountId_example; // String | Unique identifier of an ad account. Boolean pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { pins_list_200_response result = apiInstance.pins/list(bookmark, pageSize, pinFilter, includeProtectedPins, pinType, creativeTypes, adAccountId, pinMetrics); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PinsApi#pins/list"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *pinFilter = pinFilter_example; // Pin filter. (optional) (default to null)
Boolean *includeProtectedPins = true; // Specify if return pins from protected boards (optional) (default to false)
String *pinType = pinType_example; // The type of pins to return, currently only enabled for private pins (optional) (default to null)
array[String] *creativeTypes = ; // Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. (optional) (default to null) String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null) Boolean *pinMetrics = true; // Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false) // List Pins [apiInstance pins/listWith:bookmark pageSize:pageSize pinFilter:pinFilter includeProtectedPins:includeProtectedPins pinType:pinType creativeTypes:creativeTypes adAccountId:adAccountId pinMetrics:pinMetrics completionHandler: ^(pins_list_200_response output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'pinFilter': pinFilter_example, // {String} Pin filter.
  'includeProtectedPins': true, // {Boolean} Specify if return pins from protected boards
  'pinType': pinType_example, // {String} The type of pins to return, currently only enabled for private pins
  'creativeTypes': , // {array[String]} Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. 'adAccountId': adAccountId_example, // {String} Unique identifier of an ad account. 'pinMetrics': true // {Boolean} Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.pins/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var pinFilter = pinFilter_example;  // String | Pin filter. (optional)  (default to null)
            var includeProtectedPins = true;  // Boolean | Specify if return pins from protected boards (optional)  (default to false)
            var pinType = pinType_example;  // String | The type of pins to return, currently only enabled for private pins (optional)  (default to null)
            var creativeTypes = new array[String](); // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. (optional) (default to null) var adAccountId = adAccountId_example; // String | Unique identifier of an ad account. (optional) (default to null) var pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false) try { // List Pins pins_list_200_response result = apiInstance.pins/list(bookmark, pageSize, pinFilter, includeProtectedPins, pinType, creativeTypes, adAccountId, pinMetrics); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling PinsApi.pins/list: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$pinFilter = pinFilter_example; // String | Pin filter.
$includeProtectedPins = true; // Boolean | Specify if return pins from protected boards
$pinType = pinType_example; // String | The type of pins to return, currently only enabled for private pins
$creativeTypes = ; // array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. $adAccountId = adAccountId_example; // String | Unique identifier of an ad account. $pinMetrics = true; // Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. try { $result = $api_instance->pins/list($bookmark, $pageSize, $pinFilter, $includeProtectedPins, $pinType, $creativeTypes, $adAccountId, $pinMetrics); print_r($result); } catch (Exception $e) { echo 'Exception when calling PinsApi->pins/list: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $pinFilter = pinFilter_example; # String | Pin filter.
my $includeProtectedPins = true; # Boolean | Specify if return pins from protected boards
my $pinType = pinType_example; # String | The type of pins to return, currently only enabled for private pins
my $creativeTypes = []; # array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account. my $pinMetrics = true; # Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. eval { my $result = $api_instance->pins/list(bookmark => $bookmark, pageSize => $pageSize, pinFilter => $pinFilter, includeProtectedPins => $includeProtectedPins, pinType => $pinType, creativeTypes => $creativeTypes, adAccountId => $adAccountId, pinMetrics => $pinMetrics); print Dumper($result); }; if ($@) { warn "Exception when calling PinsApi->pins/list: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
pinFilter = pinFilter_example # String | Pin filter. (optional) (default to null)
includeProtectedPins = true # Boolean | Specify if return pins from protected boards (optional) (default to false)
pinType = pinType_example # String | The type of pins to return, currently only enabled for private pins (optional) (default to null)
creativeTypes =  # array[String] | Pin creative types filter. 

Note: SHOP_THE_PIN has been deprecated. Please use COLLECTION instead. (optional) (default to null) adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null) pinMetrics = true # Boolean | Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before 2023-03-20 lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then. (optional) (default to false) try: # List Pins api_response = api_instance.pins/list(bookmark=bookmark, pageSize=pageSize, pinFilter=pinFilter, includeProtectedPins=includeProtectedPins, pinType=pinType, creativeTypes=creativeTypes, adAccountId=adAccountId, pinMetrics=pinMetrics) pprint(api_response) except ApiException as e: print("Exception when calling PinsApi->pins/list: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let pinFilter = pinFilter_example; // String
    let includeProtectedPins = true; // Boolean
    let pinType = pinType_example; // String
    let creativeTypes = ; // array[String]
    let adAccountId = adAccountId_example; // String
    let pinMetrics = true; // Boolean

    let mut context = PinsApi::Context::default();
    let result = client.pins/list(bookmark, pageSize, pinFilter, includeProtectedPins, pinType, creativeTypes, adAccountId, pinMetrics, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
pins:read See your public Pins

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
pin_filter
String
Pin filter.
include_protected_pins
Boolean
Specify if return pins from protected boards
pin_type
String
The type of pins to return, currently only enabled for private pins
creative_types
array[String]
Pin creative types filter. </p><strong>Note:</strong> SHOP_THE_PIN has been deprecated. Please use COLLECTION instead.
ad_account_id
String
Unique identifier of an ad account.
pin_metrics
Boolean
Specify whether to return 90d and lifetime Pin metrics. Total comments and total reactions are only available with lifetime Pin metrics. If Pin was created before <code>2023-03-20</code> lifetime metrics will only be available for Video and Idea Pin formats. Lifetime metrics are available for all Pin formats since then.

Responses


pins/save

Save Pin

Save a Pin on a board or board section owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: - For Pins on public or protected boards: Owner, Admin, Analyst, Campaign Manager. - For Pins on secret boards: Owner, Admin. - Any Pin type can be saved: image Pin, video Pin, Idea Pin, product Pin, etc. - Any public Pin can be saved given a pin ID.


/pins/{pin_id}/save

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/pins/{pin_id}/save?ad_account_id=adAccountId_example" \
 -d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        PinsSaveRequest pinsSaveRequest = ; // PinsSaveRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/save(pinId, pinsSaveRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/save");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String pinId = new String(); // String | Unique identifier of a Pin.
final PinsSaveRequest pinsSaveRequest = new PinsSaveRequest(); // PinsSaveRequest | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.pins/save(pinId, pinsSaveRequest, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pins/save: $e\n');
}

import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        PinsSaveRequest pinsSaveRequest = ; // PinsSaveRequest | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/save(pinId, pinsSaveRequest, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/save");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
String *pinId = pinId_example; // Unique identifier of a Pin. (default to null)
PinsSaveRequest *pinsSaveRequest = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Save Pin
[apiInstance pins/saveWith:pinId
    pinsSaveRequest:pinsSaveRequest
    adAccountId:adAccountId
              completionHandler: ^(Pin output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var pinId = pinId_example; // {String} Unique identifier of a Pin.
var pinsSaveRequest = ; // {PinsSaveRequest} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.pins/save(pinId, pinsSaveRequest, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/saveExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var pinId = pinId_example;  // String | Unique identifier of a Pin. (default to null)
            var pinsSaveRequest = new PinsSaveRequest(); // PinsSaveRequest | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Save Pin
                Pin result = apiInstance.pins/save(pinId, pinsSaveRequest, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PinsApi.pins/save: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$pinId = pinId_example; // String | Unique identifier of a Pin.
$pinsSaveRequest = ; // PinsSaveRequest | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->pins/save($pinId, $pinsSaveRequest, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PinsApi->pins/save: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $pinId = pinId_example; # String | Unique identifier of a Pin.
my $pinsSaveRequest = WWW::OPenAPIClient::Object::PinsSaveRequest->new(); # PinsSaveRequest | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->pins/save(pinId => $pinId, pinsSaveRequest => $pinsSaveRequest, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PinsApi->pins/save: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
pinId = pinId_example # String | Unique identifier of a Pin. (default to null)
pinsSaveRequest =  # PinsSaveRequest | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Save Pin
    api_response = api_instance.pins/save(pinId, pinsSaveRequest, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PinsApi->pins/save: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let pinId = pinId_example; // String
    let pinsSaveRequest = ; // PinsSaveRequest
    let adAccountId = adAccountId_example; // String

    let mut context = PinsApi::Context::default();
    let result = client.pins/save(pinId, pinsSaveRequest, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards
pins:read See your public Pins
pins:write Create, update, or delete your public Pins

Parameters

Path parameters
Name Description
pin_id*
String
Unique identifier of a Pin.
Required
Body parameters
Name Description
pinsSaveRequest *

Request object used to save an existing pin

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


pins/update

Update Pin

Update a pin owned by the "operating user_account". - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an <code>ad_account_id</code> (obtained via <a href='/docs/api/v5/#operation/ad_accounts/list'>List ad accounts</a>) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a> roles on the ad_account: - For Pins on public or protected boards: Owner, Admin, Analyst, Campaign Manager. - For Pins on secret boards: Owner, Admin. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/pins/{pin_id}

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/pins/{pin_id}?ad_account_id=adAccountId_example" \
 -d '{
  "note" : "note",
  "alt_text" : "alt_text",
  "board_id" : "board_id",
  "link" : "https://www.pinterest.com/",
  "description" : "description",
  "title" : "title",
  "board_section_id" : "board_section_id",
  "carousel_slots" : [ {
    "link" : "link",
    "description" : "description",
    "title" : "title"
  }, {
    "link" : "link",
    "description" : "description",
    "title" : "title"
  } ]
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PinsApi;

import java.io.File;
import java.util.*;

public class PinsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        PinUpdate pinUpdate = ; // PinUpdate | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/update(pinId, pinUpdate, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String pinId = new String(); // String | Unique identifier of a Pin.
final PinUpdate pinUpdate = new PinUpdate(); // PinUpdate | 
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.pins/update(pinId, pinUpdate, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->pins/update: $e\n');
}

import org.openapitools.client.api.PinsApi;

public class PinsApiExample {
    public static void main(String[] args) {
        PinsApi apiInstance = new PinsApi();
        String pinId = pinId_example; // String | Unique identifier of a Pin.
        PinUpdate pinUpdate = ; // PinUpdate | 
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Pin result = apiInstance.pins/update(pinId, pinUpdate, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PinsApi#pins/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
PinsApi *apiInstance = [[PinsApi alloc] init];
String *pinId = pinId_example; // Unique identifier of a Pin. (default to null)
PinUpdate *pinUpdate = ; // 
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Update Pin
[apiInstance pins/updateWith:pinId
    pinUpdate:pinUpdate
    adAccountId:adAccountId
              completionHandler: ^(Pin output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.PinsApi()
var pinId = pinId_example; // {String} Unique identifier of a Pin.
var pinUpdate = ; // {PinUpdate} 
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.pins/update(pinId, pinUpdate, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class pins/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new PinsApi();
            var pinId = pinId_example;  // String | Unique identifier of a Pin. (default to null)
            var pinUpdate = new PinUpdate(); // PinUpdate | 
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Update Pin
                Pin result = apiInstance.pins/update(pinId, pinUpdate, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PinsApi.pins/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PinsApi();
$pinId = pinId_example; // String | Unique identifier of a Pin.
$pinUpdate = ; // PinUpdate | 
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->pins/update($pinId, $pinUpdate, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PinsApi->pins/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PinsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PinsApi->new();
my $pinId = pinId_example; # String | Unique identifier of a Pin.
my $pinUpdate = WWW::OPenAPIClient::Object::PinUpdate->new(); # PinUpdate | 
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->pins/update(pinId => $pinId, pinUpdate => $pinUpdate, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PinsApi->pins/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.PinsApi()
pinId = pinId_example # String | Unique identifier of a Pin. (default to null)
pinUpdate =  # PinUpdate | 
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Update Pin
    api_response = api_instance.pins/update(pinId, pinUpdate, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PinsApi->pins/update: %s\n" % e)
extern crate PinsApi;

pub fn main() {
    let pinId = pinId_example; // String
    let pinUpdate = ; // PinUpdate
    let adAccountId = adAccountId_example; // String

    let mut context = PinsApi::Context::default();
    let result = client.pins/update(pinId, pinUpdate, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

boards:read See your public boards, including group boards you join
boards:write Create, update, or delete your public boards
pins:read See your public Pins
pins:write Create, update, or delete your public Pins

Parameters

Path parameters
Name Description
pin_id*
String
Unique identifier of a Pin.
Required
Body parameters
Name Description
pinUpdate *

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


ProductGroupPromotions

productGroupPromotions/create

Create product group promotions

Add one or more product groups from your catalog to an existing ad group. (Product groups added to an ad group are a 'product group promotion.')


/ad_accounts/{ad_account_id}/product_group_promotions

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/product_group_promotions" \
 -d '{
  "product_group_promotion" : [ {
    "slideshow_collections_description" : "Description",
    "creative_type" : "REGULAR",
    "collections_hero_pin_id" : "123123",
    "catalog_product_group_name" : "catalogProductGroupName",
    "collections_hero_destination_url" : "http://www.pinterest.com",
    "tracking_url" : "https://www.pinterest.com",
    "slideshow_collections_title" : "Title",
    "is_mdl" : true,
    "status" : "ACTIVE"
  }, {
    "slideshow_collections_description" : "Description",
    "creative_type" : "REGULAR",
    "collections_hero_pin_id" : "123123",
    "catalog_product_group_name" : "catalogProductGroupName",
    "collections_hero_destination_url" : "http://www.pinterest.com",
    "tracking_url" : "https://www.pinterest.com",
    "slideshow_collections_title" : "Title",
    "is_mdl" : true,
    "status" : "ACTIVE"
  } ],
  "ad_group_id" : "2680059592705"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProductGroupPromotionsApi;

import java.io.File;
import java.util.*;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ProductGroupPromotionCreateRequest productGroupPromotionCreateRequest = ; // ProductGroupPromotionCreateRequest | 

        try {
            ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/create(adAccountId, productGroupPromotionCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/create");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final ProductGroupPromotionCreateRequest productGroupPromotionCreateRequest = new ProductGroupPromotionCreateRequest(); // ProductGroupPromotionCreateRequest | 

try {
    final result = await api_instance.productGroupPromotions/create(adAccountId, productGroupPromotionCreateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->productGroupPromotions/create: $e\n');
}

import org.openapitools.client.api.ProductGroupPromotionsApi;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ProductGroupPromotionCreateRequest productGroupPromotionCreateRequest = ; // ProductGroupPromotionCreateRequest | 

        try {
            ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/create(adAccountId, productGroupPromotionCreateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/create");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ProductGroupPromotionsApi *apiInstance = [[ProductGroupPromotionsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
ProductGroupPromotionCreateRequest *productGroupPromotionCreateRequest = ; // 

// Create product group promotions
[apiInstance productGroupPromotions/createWith:adAccountId
    productGroupPromotionCreateRequest:productGroupPromotionCreateRequest
              completionHandler: ^(ProductGroupPromotionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ProductGroupPromotionsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var productGroupPromotionCreateRequest = ; // {ProductGroupPromotionCreateRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.productGroupPromotions/create(adAccountId, productGroupPromotionCreateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class productGroupPromotions/createExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ProductGroupPromotionsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var productGroupPromotionCreateRequest = new ProductGroupPromotionCreateRequest(); // ProductGroupPromotionCreateRequest | 

            try {
                // Create product group promotions
                ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/create(adAccountId, productGroupPromotionCreateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProductGroupPromotionsApi.productGroupPromotions/create: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProductGroupPromotionsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$productGroupPromotionCreateRequest = ; // ProductGroupPromotionCreateRequest | 

try {
    $result = $api_instance->productGroupPromotions/create($adAccountId, $productGroupPromotionCreateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductGroupPromotionsApi->productGroupPromotions/create: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProductGroupPromotionsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProductGroupPromotionsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $productGroupPromotionCreateRequest = WWW::OPenAPIClient::Object::ProductGroupPromotionCreateRequest->new(); # ProductGroupPromotionCreateRequest | 

eval {
    my $result = $api_instance->productGroupPromotions/create(adAccountId => $adAccountId, productGroupPromotionCreateRequest => $productGroupPromotionCreateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProductGroupPromotionsApi->productGroupPromotions/create: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ProductGroupPromotionsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
productGroupPromotionCreateRequest =  # ProductGroupPromotionCreateRequest | 

try:
    # Create product group promotions
    api_response = api_instance.product_group_promotions/create(adAccountId, productGroupPromotionCreateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProductGroupPromotionsApi->productGroupPromotions/create: %s\n" % e)
extern crate ProductGroupPromotionsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let productGroupPromotionCreateRequest = ; // ProductGroupPromotionCreateRequest

    let mut context = ProductGroupPromotionsApi::Context::default();
    let result = client.productGroupPromotions/create(adAccountId, productGroupPromotionCreateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
productGroupPromotionCreateRequest *

List of Product Group Promotions to create, size limit [1, 30].

Responses


productGroupPromotions/get

Get a product group promotion by id

Get a product group promotion by id


/ad_accounts/{ad_account_id}/product_group_promotions/{product_group_promotion_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/product_group_promotions/{product_group_promotion_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProductGroupPromotionsApi;

import java.io.File;
import java.util.*;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String productGroupPromotionId = productGroupPromotionId_example; // String | Unique identifier of a product group promotion

        try {
            ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/get(adAccountId, productGroupPromotionId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String productGroupPromotionId = new String(); // String | Unique identifier of a product group promotion

try {
    final result = await api_instance.productGroupPromotions/get(adAccountId, productGroupPromotionId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->productGroupPromotions/get: $e\n');
}

import org.openapitools.client.api.ProductGroupPromotionsApi;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String productGroupPromotionId = productGroupPromotionId_example; // String | Unique identifier of a product group promotion

        try {
            ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/get(adAccountId, productGroupPromotionId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ProductGroupPromotionsApi *apiInstance = [[ProductGroupPromotionsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *productGroupPromotionId = productGroupPromotionId_example; // Unique identifier of a product group promotion (default to null)

// Get a product group promotion by id
[apiInstance productGroupPromotions/getWith:adAccountId
    productGroupPromotionId:productGroupPromotionId
              completionHandler: ^(ProductGroupPromotionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ProductGroupPromotionsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var productGroupPromotionId = productGroupPromotionId_example; // {String} Unique identifier of a product group promotion

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.productGroupPromotions/get(adAccountId, productGroupPromotionId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class productGroupPromotions/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ProductGroupPromotionsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var productGroupPromotionId = productGroupPromotionId_example;  // String | Unique identifier of a product group promotion (default to null)

            try {
                // Get a product group promotion by id
                ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/get(adAccountId, productGroupPromotionId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProductGroupPromotionsApi.productGroupPromotions/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProductGroupPromotionsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$productGroupPromotionId = productGroupPromotionId_example; // String | Unique identifier of a product group promotion

try {
    $result = $api_instance->productGroupPromotions/get($adAccountId, $productGroupPromotionId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductGroupPromotionsApi->productGroupPromotions/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProductGroupPromotionsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProductGroupPromotionsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $productGroupPromotionId = productGroupPromotionId_example; # String | Unique identifier of a product group promotion

eval {
    my $result = $api_instance->productGroupPromotions/get(adAccountId => $adAccountId, productGroupPromotionId => $productGroupPromotionId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProductGroupPromotionsApi->productGroupPromotions/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ProductGroupPromotionsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
productGroupPromotionId = productGroupPromotionId_example # String | Unique identifier of a product group promotion (default to null)

try:
    # Get a product group promotion by id
    api_response = api_instance.product_group_promotions/get(adAccountId, productGroupPromotionId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProductGroupPromotionsApi->productGroupPromotions/get: %s\n" % e)
extern crate ProductGroupPromotionsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let productGroupPromotionId = productGroupPromotionId_example; // String

    let mut context = ProductGroupPromotionsApi::Context::default();
    let result = client.productGroupPromotions/get(adAccountId, productGroupPromotionId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
product_group_promotion_id*
String
Unique identifier of a product group promotion
Required

Responses


productGroupPromotions/list

Get product group promotions

List existing product group promotions associated with an ad account. Include either ad_group_id or product_group_promotion_ids in your request. <b>Note:</b> ad_group_ids and product_group_promotion_ids are mutually exclusive parameters. Only provide one. If multiple options are provided, product_group_promotion_ids takes precedence over ad_group_ids. If none are provided, the endpoint returns an error.


/ad_accounts/{ad_account_id}/product_group_promotions

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/product_group_promotions?product_group_promotion_ids=&entity_statuses=&ad_group_id=123123123&page_size=56&order=ASCENDING&bookmark=bookmark_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProductGroupPromotionsApi;

import java.io.File;
import java.util.*;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] productGroupPromotionIds = ; // array[String] | List of Product group promotion Ids.
        array[String] entityStatuses = ; // array[String] | Entity status
        String adGroupId = 123123123; // String | Ad group Id.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            product_group_promotions_list_200_response result = apiInstance.productGroupPromotions/list(adAccountId, productGroupPromotionIds, entityStatuses, adGroupId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final array[String] productGroupPromotionIds = new array[String](); // array[String] | List of Product group promotion Ids.
final array[String] entityStatuses = new array[String](); // array[String] | Entity status
final String adGroupId = new String(); // String | Ad group Id.
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final String order = new String(); // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
final String bookmark = new String(); // String | Cursor used to fetch the next page of items

try {
    final result = await api_instance.productGroupPromotions/list(adAccountId, productGroupPromotionIds, entityStatuses, adGroupId, pageSize, order, bookmark);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->productGroupPromotions/list: $e\n');
}

import org.openapitools.client.api.ProductGroupPromotionsApi;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        array[String] productGroupPromotionIds = ; // array[String] | List of Product group promotion Ids.
        array[String] entityStatuses = ; // array[String] | Entity status
        String adGroupId = 123123123; // String | Ad group Id.
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        String order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

        try {
            product_group_promotions_list_200_response result = apiInstance.productGroupPromotions/list(adAccountId, productGroupPromotionIds, entityStatuses, adGroupId, pageSize, order, bookmark);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ProductGroupPromotionsApi *apiInstance = [[ProductGroupPromotionsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
array[String] *productGroupPromotionIds = ; // List of Product group promotion Ids. (optional) (default to null)
array[String] *entityStatuses = ; // Entity status (optional) (default to ["ACTIVE","PAUSED"])
String *adGroupId = 123123123; // Ad group Id. (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
String *order = ASCENDING; // The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)

// Get product group promotions
[apiInstance productGroupPromotions/listWith:adAccountId
    productGroupPromotionIds:productGroupPromotionIds
    entityStatuses:entityStatuses
    adGroupId:adGroupId
    pageSize:pageSize
    order:order
    bookmark:bookmark
              completionHandler: ^(product_group_promotions_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ProductGroupPromotionsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'productGroupPromotionIds': , // {array[String]} List of Product group promotion Ids.
  'entityStatuses': , // {array[String]} Entity status
  'adGroupId': 123123123, // {String} Ad group Id.
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'order': ASCENDING, // {String} The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
  'bookmark': bookmark_example // {String} Cursor used to fetch the next page of items
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.productGroupPromotions/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class productGroupPromotions/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ProductGroupPromotionsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var productGroupPromotionIds = new array[String](); // array[String] | List of Product group promotion Ids. (optional)  (default to null)
            var entityStatuses = new array[String](); // array[String] | Entity status (optional)  (default to ["ACTIVE","PAUSED"])
            var adGroupId = 123123123;  // String | Ad group Id. (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var order = ASCENDING;  // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional)  (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)

            try {
                // Get product group promotions
                product_group_promotions_list_200_response result = apiInstance.productGroupPromotions/list(adAccountId, productGroupPromotionIds, entityStatuses, adGroupId, pageSize, order, bookmark);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProductGroupPromotionsApi.productGroupPromotions/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProductGroupPromotionsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$productGroupPromotionIds = ; // array[String] | List of Product group promotion Ids.
$entityStatuses = ; // array[String] | Entity status
$adGroupId = 123123123; // String | Ad group Id.
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$order = ASCENDING; // String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items

try {
    $result = $api_instance->productGroupPromotions/list($adAccountId, $productGroupPromotionIds, $entityStatuses, $adGroupId, $pageSize, $order, $bookmark);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductGroupPromotionsApi->productGroupPromotions/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProductGroupPromotionsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProductGroupPromotionsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $productGroupPromotionIds = []; # array[String] | List of Product group promotion Ids.
my $entityStatuses = []; # array[String] | Entity status
my $adGroupId = 123123123; # String | Ad group Id.
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $order = ASCENDING; # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items.
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items

eval {
    my $result = $api_instance->productGroupPromotions/list(adAccountId => $adAccountId, productGroupPromotionIds => $productGroupPromotionIds, entityStatuses => $entityStatuses, adGroupId => $adGroupId, pageSize => $pageSize, order => $order, bookmark => $bookmark);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProductGroupPromotionsApi->productGroupPromotions/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ProductGroupPromotionsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
productGroupPromotionIds =  # array[String] | List of Product group promotion Ids. (optional) (default to null)
entityStatuses =  # array[String] | Entity status (optional) (default to ["ACTIVE","PAUSED"])
adGroupId = 123123123 # String | Ad group Id. (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
order = ASCENDING # String | The order in which to sort the items returned: “ASCENDING” or “DESCENDING”
by ID. Note that higher-value IDs are associated with more-recently added
items. (optional) (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)

try:
    # Get product group promotions
    api_response = api_instance.product_group_promotions/list(adAccountId, productGroupPromotionIds=productGroupPromotionIds, entityStatuses=entityStatuses, adGroupId=adGroupId, pageSize=pageSize, order=order, bookmark=bookmark)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProductGroupPromotionsApi->productGroupPromotions/list: %s\n" % e)
extern crate ProductGroupPromotionsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let productGroupPromotionIds = ; // array[String]
    let entityStatuses = ; // array[String]
    let adGroupId = 123123123; // String
    let pageSize = 56; // Integer
    let order = ASCENDING; // String
    let bookmark = bookmark_example; // String

    let mut context = ProductGroupPromotionsApi::Context::default();
    let result = client.productGroupPromotions/list(adAccountId, productGroupPromotionIds, entityStatuses, adGroupId, pageSize, order, bookmark, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
product_group_promotion_ids
array[String]
List of Product group promotion Ids.
entity_statuses
array[String]
Entity status
ad_group_id
String
Ad group Id.
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
order
String
The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.
bookmark
String
Cursor used to fetch the next page of items

Responses


productGroupPromotions/update

Update product group promotions

Update multiple existing Product Group Promotions (by product_group_id)


/ad_accounts/{ad_account_id}/product_group_promotions

Usage and SDK Samples

curl -X PATCH \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/product_group_promotions" \
 -d '{
  "product_group_promotion" : [ {
    "catalog_product_group_id" : "1234123",
    "slideshow_collections_description" : "Description",
    "creative_type" : "REGULAR",
    "collections_hero_pin_id" : "123123",
    "catalog_product_group_name" : "ProductGroupName",
    "collections_hero_destination_url" : "http://www.pinterest.com",
    "tracking_url" : "https://www.pinterest.com",
    "slideshow_collections_title" : "Title",
    "status" : "ACTIVE",
    "id" : "2680059592705"
  }, {
    "catalog_product_group_id" : "1231231",
    "slideshow_collections_description" : "Other description",
    "creative_type" : "REGULAR",
    "collections_hero_pin_id" : "123124",
    "catalog_product_group_name" : "ProductGroupName",
    "collections_hero_destination_url" : "http://www.pinterest.com",
    "tracking_url" : "https://www.pinterest.com",
    "slideshow_collections_title" : "Title",
    "status" : "ACTIVE",
    "id" : "2680059592706"
  } ],
  "ad_group_id" : "26823439592705"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProductGroupPromotionsApi;

import java.io.File;
import java.util.*;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ProductGroupPromotionUpdateRequest productGroupPromotionUpdateRequest = ; // ProductGroupPromotionUpdateRequest | 

        try {
            ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/update(adAccountId, productGroupPromotionUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final ProductGroupPromotionUpdateRequest productGroupPromotionUpdateRequest = new ProductGroupPromotionUpdateRequest(); // ProductGroupPromotionUpdateRequest | 

try {
    final result = await api_instance.productGroupPromotions/update(adAccountId, productGroupPromotionUpdateRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->productGroupPromotions/update: $e\n');
}

import org.openapitools.client.api.ProductGroupPromotionsApi;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        ProductGroupPromotionUpdateRequest productGroupPromotionUpdateRequest = ; // ProductGroupPromotionUpdateRequest | 

        try {
            ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/update(adAccountId, productGroupPromotionUpdateRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupPromotionsApi#productGroupPromotions/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ProductGroupPromotionsApi *apiInstance = [[ProductGroupPromotionsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
ProductGroupPromotionUpdateRequest *productGroupPromotionUpdateRequest = ; // 

// Update product group promotions
[apiInstance productGroupPromotions/updateWith:adAccountId
    productGroupPromotionUpdateRequest:productGroupPromotionUpdateRequest
              completionHandler: ^(ProductGroupPromotionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ProductGroupPromotionsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var productGroupPromotionUpdateRequest = ; // {ProductGroupPromotionUpdateRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.productGroupPromotions/update(adAccountId, productGroupPromotionUpdateRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class productGroupPromotions/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ProductGroupPromotionsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var productGroupPromotionUpdateRequest = new ProductGroupPromotionUpdateRequest(); // ProductGroupPromotionUpdateRequest | 

            try {
                // Update product group promotions
                ProductGroupPromotionResponse result = apiInstance.productGroupPromotions/update(adAccountId, productGroupPromotionUpdateRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProductGroupPromotionsApi.productGroupPromotions/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProductGroupPromotionsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$productGroupPromotionUpdateRequest = ; // ProductGroupPromotionUpdateRequest | 

try {
    $result = $api_instance->productGroupPromotions/update($adAccountId, $productGroupPromotionUpdateRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductGroupPromotionsApi->productGroupPromotions/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProductGroupPromotionsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProductGroupPromotionsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $productGroupPromotionUpdateRequest = WWW::OPenAPIClient::Object::ProductGroupPromotionUpdateRequest->new(); # ProductGroupPromotionUpdateRequest | 

eval {
    my $result = $api_instance->productGroupPromotions/update(adAccountId => $adAccountId, productGroupPromotionUpdateRequest => $productGroupPromotionUpdateRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProductGroupPromotionsApi->productGroupPromotions/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ProductGroupPromotionsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
productGroupPromotionUpdateRequest =  # ProductGroupPromotionUpdateRequest | 

try:
    # Update product group promotions
    api_response = api_instance.product_group_promotions/update(adAccountId, productGroupPromotionUpdateRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProductGroupPromotionsApi->productGroupPromotions/update: %s\n" % e)
extern crate ProductGroupPromotionsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let productGroupPromotionUpdateRequest = ; // ProductGroupPromotionUpdateRequest

    let mut context = ProductGroupPromotionsApi::Context::default();
    let result = client.productGroupPromotions/update(adAccountId, productGroupPromotionUpdateRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Body parameters
Name Description
productGroupPromotionUpdateRequest *

Parameters to update Product group promotions

Responses


productGroups/analytics

Get product group analytics

Get analytics for the specified product groups in the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href="https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts">Business Access</a>: Admin, Analyst, Campaign Manager. - If granularity is not HOUR, the furthest back you can are allowed to pull data is 90 days before the current date in UTC time and the max time range supported is 90 days. - If granularity is HOUR, the furthest back you can are allowed to pull data is 8 days before the current date in UTC time and the max time range supported is 3 days.


/ad_accounts/{ad_account_id}/product_groups/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/product_groups/analytics?start_date=2013-10-20&end_date=2013-10-20&product_group_ids=&columns=&granularity=DAY&click_window_days=1&engagement_window_days=56&view_window_days=56&conversion_report_time=TIME_OF_AD_ACTION"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProductGroupPromotionsApi;

import java.io.File;
import java.util.*;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] productGroupIds = ; // array[String] | List of Product group Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[ProductGroupAnalyticsResponse_inner] result = apiInstance.productGroups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ProductGroupPromotionsApi#productGroups/analytics"); e.printStackTrace(); } } }
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final array[String] productGroupIds = new array[String](); // array[String] | List of Product group Ids to use to filter the results.
final array[String] columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned final Granularity granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly final Integer clickWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer engagementWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. final Integer viewWindowDays = new Integer(); // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. final String conversionReportTime = new String(); // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { final result = await api_instance.productGroups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); print(result); } catch (e) { print('Exception when calling DefaultApi->productGroups/analytics: $e\n'); }
import org.openapitools.client.api.ProductGroupPromotionsApi;

public class ProductGroupPromotionsApiExample {
    public static void main(String[] args) {
        ProductGroupPromotionsApi apiInstance = new ProductGroupPromotionsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        array[String] productGroupIds = ; // array[String] | List of Product group Ids to use to filter the results.
        array[String] columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned Granularity granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly Integer clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. Integer viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. String conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { array[ProductGroupAnalyticsResponse_inner] result = apiInstance.productGroups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ProductGroupPromotionsApi#productGroups/analytics"); e.printStackTrace(); } } }
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ProductGroupPromotionsApi *apiInstance = [[ProductGroupPromotionsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
array[String] *productGroupIds = ; // List of Product group Ids to use to filter the results. (default to null)
array[String] *columns = ; // Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) Granularity *granularity = DAY; // TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) Integer *clickWindowDays = 1; // Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *engagementWindowDays = 56; // Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) Integer *viewWindowDays = 56; // Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) String *conversionReportTime = TIME_OF_AD_ACTION; // The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) // Get product group analytics [apiInstance productGroups/analyticsWith:adAccountId startDate:startDate endDate:endDate productGroupIds:productGroupIds columns:columns granularity:granularity clickWindowDays:clickWindowDays engagementWindowDays:engagementWindowDays viewWindowDays:viewWindowDays conversionReportTime:conversionReportTime completionHandler: ^(array[ProductGroupAnalyticsResponse_inner] output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ProductGroupPromotionsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var productGroupIds = ; // {array[String]} List of Product group Ids to use to filter the results.
var columns = ; // {array[String]} Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned var granularity = DAY; // {Granularity} TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly var opts = { 'clickWindowDays': 1, // {Integer} Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'engagementWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. 'viewWindowDays': 56, // {Integer} Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. 'conversionReportTime': TIME_OF_AD_ACTION // {String} The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.productGroups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class productGroups/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ProductGroupPromotionsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var productGroupIds = new array[String](); // array[String] | List of Product group Ids to use to filter the results. (default to null)
            var columns = new array[String](); // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) var granularity = new Granularity(); // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) var clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) var viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) var conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try { // Get product group analytics array[ProductGroupAnalyticsResponse_inner] result = apiInstance.productGroups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling ProductGroupPromotionsApi.productGroups/analytics: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProductGroupPromotionsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$productGroupIds = ; // array[String] | List of Product group Ids to use to filter the results.
$columns = ; // array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned $granularity = DAY; // Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly $clickWindowDays = 1; // Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $engagementWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. $viewWindowDays = 56; // Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. $conversionReportTime = TIME_OF_AD_ACTION; // String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. try { $result = $api_instance->productGroups/analytics($adAccountId, $startDate, $endDate, $productGroupIds, $columns, $granularity, $clickWindowDays, $engagementWindowDays, $viewWindowDays, $conversionReportTime); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductGroupPromotionsApi->productGroups/analytics: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProductGroupPromotionsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProductGroupPromotionsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $productGroupIds = []; # array[String] | List of Product group Ids to use to filter the results.
my $columns = []; # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned my $granularity = DAY; # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly my $clickWindowDays = 1; # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $engagementWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. my $viewWindowDays = 56; # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. my $conversionReportTime = TIME_OF_AD_ACTION; # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. eval { my $result = $api_instance->productGroups/analytics(adAccountId => $adAccountId, startDate => $startDate, endDate => $endDate, productGroupIds => $productGroupIds, columns => $columns, granularity => $granularity, clickWindowDays => $clickWindowDays, engagementWindowDays => $engagementWindowDays, viewWindowDays => $viewWindowDays, conversionReportTime => $conversionReportTime); print Dumper($result); }; if ($@) { warn "Exception when calling ProductGroupPromotionsApi->productGroups/analytics: $@\n"; }
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ProductGroupPromotionsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
productGroupIds =  # array[String] | List of Product group Ids to use to filter the results. (default to null)
columns =  # array[String] | Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.
For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).
If a column has no value, it may not be returned (default to null) granularity = DAY # Granularity | TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly (default to null) clickWindowDays = 1 # Integer | Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) engagementWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days. (optional) (default to 30) viewWindowDays = 56 # Integer | Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day. (optional) (default to 1) conversionReportTime = TIME_OF_AD_ACTION # String | The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event. (optional) (default to TIME_OF_AD_ACTION) try: # Get product group analytics api_response = api_instance.product_groups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, clickWindowDays=clickWindowDays, engagementWindowDays=engagementWindowDays, viewWindowDays=viewWindowDays, conversionReportTime=conversionReportTime) pprint(api_response) except ApiException as e: print("Exception when calling ProductGroupPromotionsApi->productGroups/analytics: %s\n" % e)
extern crate ProductGroupPromotionsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let productGroupIds = ; // array[String]
    let columns = ; // array[String]
    let granularity = DAY; // Granularity
    let clickWindowDays = 1; // Integer
    let engagementWindowDays = 56; // Integer
    let viewWindowDays = 56; // Integer
    let conversionReportTime = TIME_OF_AD_ACTION; // String

    let mut context = ProductGroupPromotionsApi::Context::default();
    let result = client.productGroups/analytics(adAccountId, startDate, endDate, productGroupIds, columns, granularity, clickWindowDays, engagementWindowDays, viewWindowDays, conversionReportTime, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
product_group_ids*
array[String]
List of Product group Ids to use to filter the results.
Required
columns*
array[String]
Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
Required
granularity*
Granularity
TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly
Required
click_window_days
Integer
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
engagement_window_days
Integer
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.
view_window_days
Integer
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.
conversion_report_time
String
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.

Responses


ProductGroups

adAccountsCatalogsProductGroups/list

Get catalog product groups

This endpoint is completely deprecated. Please use <a href='/docs/api/v5/#operation/catalogs_product_groups/list'>List product groups</a> from Catalogs API instead.


/ad_accounts/{ad_account_id}/product_groups/catalogs

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/product_groups/catalogs?feed_profile_id=feedProfileId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ProductGroupsApi;

import java.io.File;
import java.util.*;

public class ProductGroupsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ProductGroupsApi apiInstance = new ProductGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String feedProfileId = feedProfileId_example; // String | The feed profile id whose catalog product groups we want to return.

        try {
            ad_accounts_catalogs_product_groups_list_200_response result = apiInstance.adAccountsCatalogsProductGroups/list(adAccountId, feedProfileId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupsApi#adAccountsCatalogsProductGroups/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final String feedProfileId = new String(); // String | The feed profile id whose catalog product groups we want to return.

try {
    final result = await api_instance.adAccountsCatalogsProductGroups/list(adAccountId, feedProfileId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccountsCatalogsProductGroups/list: $e\n');
}

import org.openapitools.client.api.ProductGroupsApi;

public class ProductGroupsApiExample {
    public static void main(String[] args) {
        ProductGroupsApi apiInstance = new ProductGroupsApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        String feedProfileId = feedProfileId_example; // String | The feed profile id whose catalog product groups we want to return.

        try {
            ad_accounts_catalogs_product_groups_list_200_response result = apiInstance.adAccountsCatalogsProductGroups/list(adAccountId, feedProfileId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductGroupsApi#adAccountsCatalogsProductGroups/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ProductGroupsApi *apiInstance = [[ProductGroupsApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
String *feedProfileId = feedProfileId_example; // The feed profile id whose catalog product groups we want to return. (optional) (default to null)

// Get catalog product groups
[apiInstance adAccountsCatalogsProductGroups/listWith:adAccountId
    feedProfileId:feedProfileId
              completionHandler: ^(ad_accounts_catalogs_product_groups_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ProductGroupsApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'feedProfileId': feedProfileId_example // {String} The feed profile id whose catalog product groups we want to return.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccountsCatalogsProductGroups/list(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountsCatalogsProductGroups/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ProductGroupsApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var feedProfileId = feedProfileId_example;  // String | The feed profile id whose catalog product groups we want to return. (optional)  (default to null)

            try {
                // Get catalog product groups
                ad_accounts_catalogs_product_groups_list_200_response result = apiInstance.adAccountsCatalogsProductGroups/list(adAccountId, feedProfileId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ProductGroupsApi.adAccountsCatalogsProductGroups/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ProductGroupsApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$feedProfileId = feedProfileId_example; // String | The feed profile id whose catalog product groups we want to return.

try {
    $result = $api_instance->adAccountsCatalogsProductGroups/list($adAccountId, $feedProfileId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductGroupsApi->adAccountsCatalogsProductGroups/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ProductGroupsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ProductGroupsApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $feedProfileId = feedProfileId_example; # String | The feed profile id whose catalog product groups we want to return.

eval {
    my $result = $api_instance->adAccountsCatalogsProductGroups/list(adAccountId => $adAccountId, feedProfileId => $feedProfileId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ProductGroupsApi->adAccountsCatalogsProductGroups/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ProductGroupsApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
feedProfileId = feedProfileId_example # String | The feed profile id whose catalog product groups we want to return. (optional) (default to null)

try:
    # Get catalog product groups
    api_response = api_instance.ad_accounts_catalogs_product_groups/list(adAccountId, feedProfileId=feedProfileId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProductGroupsApi->adAccountsCatalogsProductGroups/list: %s\n" % e)
extern crate ProductGroupsApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let feedProfileId = feedProfileId_example; // String

    let mut context = ProductGroupsApi::Context::default();
    let result = client.adAccountsCatalogsProductGroups/list(adAccountId, feedProfileId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:write Create, update, or delete ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
feed_profile_id
String
The feed profile id whose catalog product groups we want to return.

Responses


Resources

adAccountCountries/get

Get ad accounts countries

Get Ad Accounts countries


/resources/ad_account_countries

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/resources/ad_account_countries"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ResourcesApi;

import java.io.File;
import java.util.*;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ResourcesApi apiInstance = new ResourcesApi();

        try {
            AdAccountsCountryResponse result = apiInstance.adAccountCountries/get();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#adAccountCountries/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.adAccountCountries/get();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->adAccountCountries/get: $e\n');
}

import org.openapitools.client.api.ResourcesApi;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ResourcesApi apiInstance = new ResourcesApi();

        try {
            AdAccountsCountryResponse result = apiInstance.adAccountCountries/get();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#adAccountCountries/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ResourcesApi *apiInstance = [[ResourcesApi alloc] init];

// Get ad accounts countries
[apiInstance adAccountCountries/getWithCompletionHandler: 
              ^(AdAccountsCountryResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ResourcesApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.adAccountCountries/get(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class adAccountCountries/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ResourcesApi();

            try {
                // Get ad accounts countries
                AdAccountsCountryResponse result = apiInstance.adAccountCountries/get();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ResourcesApi.adAccountCountries/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ResourcesApi();

try {
    $result = $api_instance->adAccountCountries/get();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->adAccountCountries/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ResourcesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ResourcesApi->new();

eval {
    my $result = $api_instance->adAccountCountries/get();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ResourcesApi->adAccountCountries/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ResourcesApi()

try:
    # Get ad accounts countries
    api_response = api_instance.ad_account_countries/get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourcesApi->adAccountCountries/get: %s\n" % e)
extern crate ResourcesApi;

pub fn main() {

    let mut context = ResourcesApi::Context::default();
    let result = client.adAccountCountries/get(&context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Responses


deliveryMetrics/get

Get available metrics' definitions

Get the definitions for ads and organic metrics available across both synchronous and asynchronous report endpoints. The `display_name` attribute will match how the metric is named in our native tools like Ads Manager. See <a href='/docs/content/analytics/'>Organic Analytics</a> and <a href='/docs/ads/ad-analytics-reporting/'>Ads Analytics</a> for more information.


/resources/delivery_metrics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/resources/delivery_metrics?report_type=reportType_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ResourcesApi;

import java.io.File;
import java.util.*;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ResourcesApi apiInstance = new ResourcesApi();
        String reportType = reportType_example; // String | Report type.

        try {
            DeliveryMetricsResponse result = apiInstance.deliveryMetrics/get(reportType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#deliveryMetrics/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String reportType = new String(); // String | Report type.

try {
    final result = await api_instance.deliveryMetrics/get(reportType);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->deliveryMetrics/get: $e\n');
}

import org.openapitools.client.api.ResourcesApi;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ResourcesApi apiInstance = new ResourcesApi();
        String reportType = reportType_example; // String | Report type.

        try {
            DeliveryMetricsResponse result = apiInstance.deliveryMetrics/get(reportType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#deliveryMetrics/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ResourcesApi *apiInstance = [[ResourcesApi alloc] init];
String *reportType = reportType_example; // Report type. (optional) (default to null)

// Get available metrics' definitions
[apiInstance deliveryMetrics/getWith:reportType
              completionHandler: ^(DeliveryMetricsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ResourcesApi()
var opts = {
  'reportType': reportType_example // {String} Report type.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deliveryMetrics/get(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class deliveryMetrics/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ResourcesApi();
            var reportType = reportType_example;  // String | Report type. (optional)  (default to null)

            try {
                // Get available metrics' definitions
                DeliveryMetricsResponse result = apiInstance.deliveryMetrics/get(reportType);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ResourcesApi.deliveryMetrics/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ResourcesApi();
$reportType = reportType_example; // String | Report type.

try {
    $result = $api_instance->deliveryMetrics/get($reportType);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->deliveryMetrics/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ResourcesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ResourcesApi->new();
my $reportType = reportType_example; # String | Report type.

eval {
    my $result = $api_instance->deliveryMetrics/get(reportType => $reportType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ResourcesApi->deliveryMetrics/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ResourcesApi()
reportType = reportType_example # String | Report type. (optional) (default to null)

try:
    # Get available metrics' definitions
    api_response = api_instance.delivery_metrics/get(reportType=reportType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourcesApi->deliveryMetrics/get: %s\n" % e)
extern crate ResourcesApi;

pub fn main() {
    let reportType = reportType_example; // String

    let mut context = ResourcesApi::Context::default();
    let result = client.deliveryMetrics/get(reportType, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.
pins:read See your public Pins
user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
report_type
String
Report type.

Responses


interestTargetingOptions/get

Get interest details

<p>Get details of a specific interest given interest ID.</p> <p>Click <a href="https://docs.google.com/spreadsheets/d/1HxL-0Z3p2fgxis9YBP2HWC3tvPrs1hAuHDRtH-NJTIM/edit#gid=118370875" target="_blank">here</a> for a spreadsheet listing interests and their IDs.</p>


/resources/targeting/interests/{interest_id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/resources/targeting/interests/{interest_id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ResourcesApi;

import java.io.File;
import java.util.*;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ResourcesApi apiInstance = new ResourcesApi();
        String interestId = interestId_example; // String | Unique identifier of an interest.

        try {
            SingleInterestTargetingOptionResponse result = apiInstance.interestTargetingOptions/get(interestId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#interestTargetingOptions/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String interestId = new String(); // String | Unique identifier of an interest.

try {
    final result = await api_instance.interestTargetingOptions/get(interestId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->interestTargetingOptions/get: $e\n');
}

import org.openapitools.client.api.ResourcesApi;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ResourcesApi apiInstance = new ResourcesApi();
        String interestId = interestId_example; // String | Unique identifier of an interest.

        try {
            SingleInterestTargetingOptionResponse result = apiInstance.interestTargetingOptions/get(interestId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#interestTargetingOptions/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ResourcesApi *apiInstance = [[ResourcesApi alloc] init];
String *interestId = interestId_example; // Unique identifier of an interest. (default to null)

// Get interest details
[apiInstance interestTargetingOptions/getWith:interestId
              completionHandler: ^(SingleInterestTargetingOptionResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ResourcesApi()
var interestId = interestId_example; // {String} Unique identifier of an interest.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.interestTargetingOptions/get(interestId, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class interestTargetingOptions/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ResourcesApi();
            var interestId = interestId_example;  // String | Unique identifier of an interest. (default to null)

            try {
                // Get interest details
                SingleInterestTargetingOptionResponse result = apiInstance.interestTargetingOptions/get(interestId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ResourcesApi.interestTargetingOptions/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ResourcesApi();
$interestId = interestId_example; // String | Unique identifier of an interest.

try {
    $result = $api_instance->interestTargetingOptions/get($interestId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->interestTargetingOptions/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ResourcesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ResourcesApi->new();
my $interestId = interestId_example; # String | Unique identifier of an interest.

eval {
    my $result = $api_instance->interestTargetingOptions/get(interestId => $interestId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ResourcesApi->interestTargetingOptions/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ResourcesApi()
interestId = interestId_example # String | Unique identifier of an interest. (default to null)

try:
    # Get interest details
    api_response = api_instance.interest_targeting_options/get(interestId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourcesApi->interestTargetingOptions/get: %s\n" % e)
extern crate ResourcesApi;

pub fn main() {
    let interestId = interestId_example; // String

    let mut context = ResourcesApi::Context::default();
    let result = client.interestTargetingOptions/get(interestId, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
interest_id*
String
Unique identifier of an interest.
Required

Responses


leadFormQuestions/get

Get lead form questions

Get a list of all lead form question type names. Some questions might not be used. <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong>


/resources/lead_form_questions

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/resources/lead_form_questions"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ResourcesApi;

import java.io.File;
import java.util.*;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ResourcesApi apiInstance = new ResourcesApi();

        try {
            apiInstance.leadFormQuestions/get();
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#leadFormQuestions/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.leadFormQuestions/get();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->leadFormQuestions/get: $e\n');
}

import org.openapitools.client.api.ResourcesApi;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ResourcesApi apiInstance = new ResourcesApi();

        try {
            apiInstance.leadFormQuestions/get();
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#leadFormQuestions/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ResourcesApi *apiInstance = [[ResourcesApi alloc] init];

// Get lead form questions
[apiInstance leadFormQuestions/getWithCompletionHandler: 
              ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ResourcesApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.leadFormQuestions/get(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class leadFormQuestions/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ResourcesApi();

            try {
                // Get lead form questions
                apiInstance.leadFormQuestions/get();
            } catch (Exception e) {
                Debug.Print("Exception when calling ResourcesApi.leadFormQuestions/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ResourcesApi();

try {
    $api_instance->leadFormQuestions/get();
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->leadFormQuestions/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ResourcesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ResourcesApi->new();

eval {
    $api_instance->leadFormQuestions/get();
};
if ($@) {
    warn "Exception when calling ResourcesApi->leadFormQuestions/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ResourcesApi()

try:
    # Get lead form questions
    api_instance.lead_form_questions/get()
except ApiException as e:
    print("Exception when calling ResourcesApi->leadFormQuestions/get: %s\n" % e)
extern crate ResourcesApi;

pub fn main() {

    let mut context = ResourcesApi::Context::default();
    let result = client.leadFormQuestions/get(&context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Responses


metricsReadyState/get

Get metrics ready state

Learn whether conversion or non-conversion metrics are finalized and ready to query.


/resources/metrics_ready_state

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/resources/metrics_ready_state?date=2022-07-13"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ResourcesApi;

import java.io.File;
import java.util.*;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ResourcesApi apiInstance = new ResourcesApi();
        String date = 2022-07-13; // String | Analytics reports request date (UTC). Format: YYYY-MM-DD

        try {
            BookClosedResponse result = apiInstance.metricsReadyState/get(date);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#metricsReadyState/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String date = new String(); // String | Analytics reports request date (UTC). Format: YYYY-MM-DD

try {
    final result = await api_instance.metricsReadyState/get(date);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->metricsReadyState/get: $e\n');
}

import org.openapitools.client.api.ResourcesApi;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ResourcesApi apiInstance = new ResourcesApi();
        String date = 2022-07-13; // String | Analytics reports request date (UTC). Format: YYYY-MM-DD

        try {
            BookClosedResponse result = apiInstance.metricsReadyState/get(date);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#metricsReadyState/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ResourcesApi *apiInstance = [[ResourcesApi alloc] init];
String *date = 2022-07-13; // Analytics reports request date (UTC). Format: YYYY-MM-DD (default to null)

// Get metrics ready state
[apiInstance metricsReadyState/getWith:date
              completionHandler: ^(BookClosedResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ResourcesApi()
var date = 2022-07-13; // {String} Analytics reports request date (UTC). Format: YYYY-MM-DD

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.metricsReadyState/get(date, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class metricsReadyState/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ResourcesApi();
            var date = 2022-07-13;  // String | Analytics reports request date (UTC). Format: YYYY-MM-DD (default to null)

            try {
                // Get metrics ready state
                BookClosedResponse result = apiInstance.metricsReadyState/get(date);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ResourcesApi.metricsReadyState/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ResourcesApi();
$date = 2022-07-13; // String | Analytics reports request date (UTC). Format: YYYY-MM-DD

try {
    $result = $api_instance->metricsReadyState/get($date);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->metricsReadyState/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ResourcesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ResourcesApi->new();
my $date = 2022-07-13; # String | Analytics reports request date (UTC). Format: YYYY-MM-DD

eval {
    my $result = $api_instance->metricsReadyState/get(date => $date);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ResourcesApi->metricsReadyState/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ResourcesApi()
date = 2022-07-13 # String | Analytics reports request date (UTC). Format: YYYY-MM-DD (default to null)

try:
    # Get metrics ready state
    api_response = api_instance.metrics_ready_state/get(date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourcesApi->metricsReadyState/get: %s\n" % e)
extern crate ResourcesApi;

pub fn main() {
    let date = 2022-07-13; // String

    let mut context = ResourcesApi::Context::default();
    let result = client.metricsReadyState/get(date, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Query parameters
Name Description
date*
String
Analytics reports request date (UTC). Format: YYYY-MM-DD
Required

Responses


targetingOptions/get

Get targeting options

<p>You can use targeting values in ads placement to define your intended audience. </p> <p>Targeting metrics are organized around targeting specifications.</p> <p>For more information on ads targeting, see <a class="reference external" href="https://help.pinterest.com/en/business/article/audience-targeting" target="_blank">Audience targeting</a>.</p> <p><b>Sample return:</b></p> <pre class="literal-block"> [{&quot;36313&quot;: &quot;Australia: Moreton Bay - North&quot;, &quot;124735&quot;: &quot;Canada: North Battleford&quot;, &quot;36109&quot;: &quot;Australia: Murray&quot;, &quot;36108&quot;: &quot;Australia: Mid North Coast&quot;, &quot;36101&quot;: &quot;Australia: Capital Region&quot;, &quot;811&quot;: &quot;U.S.: Reno&quot;, &quot;36103&quot;: &quot;Australia: Central West&quot;, &quot;36102&quot;: &quot;Australia: Central Coast&quot;, &quot;36105&quot;: &quot;Australia: Far West and Orana&quot;, &quot;36104&quot;: &quot;Australia: Coffs Harbour - Grafton&quot;, &quot;36107&quot;: &quot;Australia: Illawarra&quot;, &quot;36106&quot;: &quot;Australia: Hunter Valley Exc Newcastle&quot;, &quot;554017&quot;: &quot;New Zealand: Wanganui&quot;, &quot;554016&quot;: &quot;New Zealand: Marlborough&quot;, &quot;554015&quot;: &quot;New Zealand: Gisborne&quot;, &quot;554014&quot;: &quot;New Zealand: Tararua&quot;, &quot;554013&quot;: &quot;New Zealand: Invercargill&quot;, &quot;GR&quot;: &quot;Greece&quot;, &quot;554011&quot;: &quot;New Zealand: Whangarei&quot;, &quot;554010&quot;: &quot;New Zealand: Far North&quot;, &quot;717&quot;: &quot;U.S.: Quincy-Hannibal-Keokuk&quot;, &quot;716&quot;: &quot;U.S.: Baton Rouge&quot;,...}] </pre>


/resources/targeting/{targeting_type}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/resources/targeting/{targeting_type}?client_id=1094834&oauth_signature=8209f×tamp=1618338184277"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.ResourcesApi;

import java.io.File;
import java.util.*;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        ResourcesApi apiInstance = new ResourcesApi();
        String targetingType = APPTYPE; // String | Public targeting type.
        String clientId = 1094834; // String | Client ID.
        String oauthSignature = 8209f; // String | Oauth signature
        String timestamp = 1618338184277; // String | Timestamp

        try {
            array[Object] result = apiInstance.targetingOptions/get(targetingType, clientId, oauthSignature, timestamp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#targetingOptions/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String targetingType = new String(); // String | Public targeting type.
final String clientId = new String(); // String | Client ID.
final String oauthSignature = new String(); // String | Oauth signature
final String timestamp = new String(); // String | Timestamp

try {
    final result = await api_instance.targetingOptions/get(targetingType, clientId, oauthSignature, timestamp);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->targetingOptions/get: $e\n');
}

import org.openapitools.client.api.ResourcesApi;

public class ResourcesApiExample {
    public static void main(String[] args) {
        ResourcesApi apiInstance = new ResourcesApi();
        String targetingType = APPTYPE; // String | Public targeting type.
        String clientId = 1094834; // String | Client ID.
        String oauthSignature = 8209f; // String | Oauth signature
        String timestamp = 1618338184277; // String | Timestamp

        try {
            array[Object] result = apiInstance.targetingOptions/get(targetingType, clientId, oauthSignature, timestamp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ResourcesApi#targetingOptions/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
ResourcesApi *apiInstance = [[ResourcesApi alloc] init];
String *targetingType = APPTYPE; // Public targeting type. (default to null)
String *clientId = 1094834; // Client ID. (optional) (default to null)
String *oauthSignature = 8209f; // Oauth signature (optional) (default to null)
String *timestamp = 1618338184277; // Timestamp (optional) (default to null)

// Get targeting options
[apiInstance targetingOptions/getWith:targetingType
    clientId:clientId
    oauthSignature:oauthSignature
    timestamp:timestamp
              completionHandler: ^(array[Object] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.ResourcesApi()
var targetingType = APPTYPE; // {String} Public targeting type.
var opts = {
  'clientId': 1094834, // {String} Client ID.
  'oauthSignature': 8209f, // {String} Oauth signature
  'timestamp': 1618338184277 // {String} Timestamp
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.targetingOptions/get(targetingType, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class targetingOptions/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new ResourcesApi();
            var targetingType = APPTYPE;  // String | Public targeting type. (default to null)
            var clientId = 1094834;  // String | Client ID. (optional)  (default to null)
            var oauthSignature = 8209f;  // String | Oauth signature (optional)  (default to null)
            var timestamp = 1618338184277;  // String | Timestamp (optional)  (default to null)

            try {
                // Get targeting options
                array[Object] result = apiInstance.targetingOptions/get(targetingType, clientId, oauthSignature, timestamp);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling ResourcesApi.targetingOptions/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\ResourcesApi();
$targetingType = APPTYPE; // String | Public targeting type.
$clientId = 1094834; // String | Client ID.
$oauthSignature = 8209f; // String | Oauth signature
$timestamp = 1618338184277; // String | Timestamp

try {
    $result = $api_instance->targetingOptions/get($targetingType, $clientId, $oauthSignature, $timestamp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->targetingOptions/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::ResourcesApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::ResourcesApi->new();
my $targetingType = APPTYPE; # String | Public targeting type.
my $clientId = 1094834; # String | Client ID.
my $oauthSignature = 8209f; # String | Oauth signature
my $timestamp = 1618338184277; # String | Timestamp

eval {
    my $result = $api_instance->targetingOptions/get(targetingType => $targetingType, clientId => $clientId, oauthSignature => $oauthSignature, timestamp => $timestamp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ResourcesApi->targetingOptions/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.ResourcesApi()
targetingType = APPTYPE # String | Public targeting type. (default to null)
clientId = 1094834 # String | Client ID. (optional) (default to null)
oauthSignature = 8209f # String | Oauth signature (optional) (default to null)
timestamp = 1618338184277 # String | Timestamp (optional) (default to null)

try:
    # Get targeting options
    api_response = api_instance.targeting_options/get(targetingType, clientId=clientId, oauthSignature=oauthSignature, timestamp=timestamp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourcesApi->targetingOptions/get: %s\n" % e)
extern crate ResourcesApi;

pub fn main() {
    let targetingType = APPTYPE; // String
    let clientId = 1094834; // String
    let oauthSignature = 8209f; // String
    let timestamp = 1618338184277; // String

    let mut context = ResourcesApi::Context::default();
    let result = client.targetingOptions/get(targetingType, clientId, oauthSignature, timestamp, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
targeting_type*
String
Public targeting type.
Required
Query parameters
Name Description
client_id
String
Client ID.
oauth_signature
String
Oauth signature
timestamp
String
Timestamp

Responses


Terms

termsRelated/list

List related terms

Get a list of terms logically related to each input term. <p/> Example: the term 'workout' would list related terms like 'one song workout', 'yoga workout', 'workout motivation', etc.


/terms/related

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/terms/related?terms="
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.TermsApi;

import java.io.File;
import java.util.*;

public class TermsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        TermsApi apiInstance = new TermsApi();
        array[String] terms = ; // array[String] | List of input terms.

        try {
            RelatedTerms result = apiInstance.termsRelated/list(terms);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TermsApi#termsRelated/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final array[String] terms = new array[String](); // array[String] | List of input terms.

try {
    final result = await api_instance.termsRelated/list(terms);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->termsRelated/list: $e\n');
}

import org.openapitools.client.api.TermsApi;

public class TermsApiExample {
    public static void main(String[] args) {
        TermsApi apiInstance = new TermsApi();
        array[String] terms = ; // array[String] | List of input terms.

        try {
            RelatedTerms result = apiInstance.termsRelated/list(terms);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TermsApi#termsRelated/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
TermsApi *apiInstance = [[TermsApi alloc] init];
array[String] *terms = ; // List of input terms. (default to null)

// List related terms
[apiInstance termsRelated/listWith:terms
              completionHandler: ^(RelatedTerms output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.TermsApi()
var terms = ; // {array[String]} List of input terms.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.termsRelated/list(terms, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class termsRelated/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new TermsApi();
            var terms = new array[String](); // array[String] | List of input terms. (default to null)

            try {
                // List related terms
                RelatedTerms result = apiInstance.termsRelated/list(terms);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling TermsApi.termsRelated/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\TermsApi();
$terms = ; // array[String] | List of input terms.

try {
    $result = $api_instance->termsRelated/list($terms);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TermsApi->termsRelated/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::TermsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::TermsApi->new();
my $terms = []; # array[String] | List of input terms.

eval {
    my $result = $api_instance->termsRelated/list(terms => $terms);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TermsApi->termsRelated/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.TermsApi()
terms =  # array[String] | List of input terms. (default to null)

try:
    # List related terms
    api_response = api_instance.terms_related/list(terms)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TermsApi->termsRelated/list: %s\n" % e)
extern crate TermsApi;

pub fn main() {
    let terms = ; // array[String]

    let mut context = TermsApi::Context::default();
    let result = client.termsRelated/list(terms, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Query parameters
Name Description
terms*
array[String]
List of input terms.
Required

Responses


termsSuggested/list

List suggested terms

Get popular search terms that begin with your input term. <p/> Example: 'sport' would return popular terms like 'sports bar' and 'sportswear', but not 'motor sports' since the phrase does not begin with the given term.


/terms/suggested

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/terms/suggested?term=sports&limit=4"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.TermsApi;

import java.io.File;
import java.util.*;

public class TermsApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        TermsApi apiInstance = new TermsApi();
        String term = sports; // String | Input term.
        Integer limit = 4; // Integer | Max suggested terms to return.

        try {
            array['String'] result = apiInstance.termsSuggested/list(term, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TermsApi#termsSuggested/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String term = new String(); // String | Input term.
final Integer limit = new Integer(); // Integer | Max suggested terms to return.

try {
    final result = await api_instance.termsSuggested/list(term, limit);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->termsSuggested/list: $e\n');
}

import org.openapitools.client.api.TermsApi;

public class TermsApiExample {
    public static void main(String[] args) {
        TermsApi apiInstance = new TermsApi();
        String term = sports; // String | Input term.
        Integer limit = 4; // Integer | Max suggested terms to return.

        try {
            array['String'] result = apiInstance.termsSuggested/list(term, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TermsApi#termsSuggested/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
TermsApi *apiInstance = [[TermsApi alloc] init];
String *term = sports; // Input term. (default to null)
Integer *limit = 4; // Max suggested terms to return. (optional) (default to 4)

// List suggested terms
[apiInstance termsSuggested/listWith:term
    limit:limit
              completionHandler: ^(array['String'] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.TermsApi()
var term = sports; // {String} Input term.
var opts = {
  'limit': 4 // {Integer} Max suggested terms to return.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.termsSuggested/list(term, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class termsSuggested/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new TermsApi();
            var term = sports;  // String | Input term. (default to null)
            var limit = 4;  // Integer | Max suggested terms to return. (optional)  (default to 4)

            try {
                // List suggested terms
                array['String'] result = apiInstance.termsSuggested/list(term, limit);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling TermsApi.termsSuggested/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\TermsApi();
$term = sports; // String | Input term.
$limit = 4; // Integer | Max suggested terms to return.

try {
    $result = $api_instance->termsSuggested/list($term, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TermsApi->termsSuggested/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::TermsApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::TermsApi->new();
my $term = sports; # String | Input term.
my $limit = 4; # Integer | Max suggested terms to return.

eval {
    my $result = $api_instance->termsSuggested/list(term => $term, limit => $limit);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TermsApi->termsSuggested/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.TermsApi()
term = sports # String | Input term. (default to null)
limit = 4 # Integer | Max suggested terms to return. (optional) (default to 4)

try:
    # List suggested terms
    api_response = api_instance.terms_suggested/list(term, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TermsApi->termsSuggested/list: %s\n" % e)
extern crate TermsApi;

pub fn main() {
    let term = sports; // String
    let limit = 4; // Integer

    let mut context = TermsApi::Context::default();
    let result = client.termsSuggested/list(term, limit, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Query parameters
Name Description
term*
String
Input term.
Required
limit
Integer
Max suggested terms to return.

Responses


TermsOfService

termsOfService/get

Get terms of service

Get the text of the terms of service and see whether the advertiser has accepted the terms of service.


/ad_accounts/{ad_account_id}/terms_of_service

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/terms_of_service?include_html=true&tos_type=tosType_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.TermsOfServiceApi;

import java.io.File;
import java.util.*;

public class TermsOfServiceApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        TermsOfServiceApi apiInstance = new TermsOfServiceApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Boolean includeHtml = true; // Boolean | Return HTML in TOS text.
        String tosType = tosType_example; // String | Request type.

        try {
            TermsOfService result = apiInstance.termsOfService/get(adAccountId, includeHtml, tosType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TermsOfServiceApi#termsOfService/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.
final Boolean includeHtml = new Boolean(); // Boolean | Return HTML in TOS text.
final String tosType = new String(); // String | Request type.

try {
    final result = await api_instance.termsOfService/get(adAccountId, includeHtml, tosType);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->termsOfService/get: $e\n');
}

import org.openapitools.client.api.TermsOfServiceApi;

public class TermsOfServiceApiExample {
    public static void main(String[] args) {
        TermsOfServiceApi apiInstance = new TermsOfServiceApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
        Boolean includeHtml = true; // Boolean | Return HTML in TOS text.
        String tosType = tosType_example; // String | Request type.

        try {
            TermsOfService result = apiInstance.termsOfService/get(adAccountId, includeHtml, tosType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TermsOfServiceApi#termsOfService/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
TermsOfServiceApi *apiInstance = [[TermsOfServiceApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (default to null)
Boolean *includeHtml = true; // Return HTML in TOS text. (optional) (default to false)
String *tosType = tosType_example; // Request type. (optional) (default to null)

// Get terms of service
[apiInstance termsOfService/getWith:adAccountId
    includeHtml:includeHtml
    tosType:tosType
              completionHandler: ^(TermsOfService output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.TermsOfServiceApi()
var adAccountId = adAccountId_example; // {String} Unique identifier of an ad account.
var opts = {
  'includeHtml': true, // {Boolean} Return HTML in TOS text.
  'tosType': tosType_example // {String} Request type.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.termsOfService/get(adAccountId, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class termsOfService/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new TermsOfServiceApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (default to null)
            var includeHtml = true;  // Boolean | Return HTML in TOS text. (optional)  (default to false)
            var tosType = tosType_example;  // String | Request type. (optional)  (default to null)

            try {
                // Get terms of service
                TermsOfService result = apiInstance.termsOfService/get(adAccountId, includeHtml, tosType);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling TermsOfServiceApi.termsOfService/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\TermsOfServiceApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.
$includeHtml = true; // Boolean | Return HTML in TOS text.
$tosType = tosType_example; // String | Request type.

try {
    $result = $api_instance->termsOfService/get($adAccountId, $includeHtml, $tosType);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TermsOfServiceApi->termsOfService/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::TermsOfServiceApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::TermsOfServiceApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.
my $includeHtml = true; # Boolean | Return HTML in TOS text.
my $tosType = tosType_example; # String | Request type.

eval {
    my $result = $api_instance->termsOfService/get(adAccountId => $adAccountId, includeHtml => $includeHtml, tosType => $tosType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TermsOfServiceApi->termsOfService/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.TermsOfServiceApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (default to null)
includeHtml = true # Boolean | Return HTML in TOS text. (optional) (default to false)
tosType = tosType_example # String | Request type. (optional) (default to null)

try:
    # Get terms of service
    api_response = api_instance.terms_of_service/get(adAccountId, includeHtml=includeHtml, tosType=tosType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TermsOfServiceApi->termsOfService/get: %s\n" % e)
extern crate TermsOfServiceApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String
    let includeHtml = true; // Boolean
    let tosType = tosType_example; // String

    let mut context = TermsOfServiceApi::Context::default();
    let result = client.termsOfService/get(adAccountId, includeHtml, tosType, &context).wait();

    println!("{:?}", result);
}

Scopes

ads:read See all of your advertising data, including ads, ad groups, campaigns etc.

Parameters

Path parameters
Name Description
ad_account_id*
String
Unique identifier of an ad account.
Required
Query parameters
Name Description
include_html
Boolean
Return HTML in TOS text.
tos_type
String
Request type.

Responses


UserAccount

boardsUserFollows/list

List following boards

Get a list of the boards a user follows. The request returns a board summary object array.


/user_account/following/boards

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/following/boards?bookmark=bookmark_example&page_size=56&explicit_following=true&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        Boolean explicitFollowing = true; // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            boards_user_follows_list_200_response result = apiInstance.boardsUserFollows/list(bookmark, pageSize, explicitFollowing, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#boardsUserFollows/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final Boolean explicitFollowing = new Boolean(); // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.boardsUserFollows/list(bookmark, pageSize, explicitFollowing, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->boardsUserFollows/list: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        Boolean explicitFollowing = true; // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            boards_user_follows_list_200_response result = apiInstance.boardsUserFollows/list(bookmark, pageSize, explicitFollowing, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#boardsUserFollows/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
Boolean *explicitFollowing = true; // Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows. (optional) (default to false)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List following boards
[apiInstance boardsUserFollows/listWith:bookmark
    pageSize:pageSize
    explicitFollowing:explicitFollowing
    adAccountId:adAccountId
              completionHandler: ^(boards_user_follows_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'explicitFollowing': true, // {Boolean} Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.boardsUserFollows/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class boardsUserFollows/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var explicitFollowing = true;  // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows. (optional)  (default to false)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List following boards
                boards_user_follows_list_200_response result = apiInstance.boardsUserFollows/list(bookmark, pageSize, explicitFollowing, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.boardsUserFollows/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$explicitFollowing = true; // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->boardsUserFollows/list($bookmark, $pageSize, $explicitFollowing, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->boardsUserFollows/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $explicitFollowing = true; # Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->boardsUserFollows/list(bookmark => $bookmark, pageSize => $pageSize, explicitFollowing => $explicitFollowing, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->boardsUserFollows/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
explicitFollowing = true # Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows. (optional) (default to false)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List following boards
    api_response = api_instance.boards_user_follows/list(bookmark=bookmark, pageSize=pageSize, explicitFollowing=explicitFollowing, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->boardsUserFollows/list: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let explicitFollowing = true; // Boolean
    let adAccountId = adAccountId_example; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.boardsUserFollows/list(bookmark, pageSize, explicitFollowing, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
explicit_following
Boolean
Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
ad_account_id
String
Unique identifier of an ad account.

Responses


followUser/update

Follow user

<strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/new/about-beta-access/'>Learn more</a>.</strong> Use this request, as a signed-in user, to follow another user.


/user_account/following/{username}

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/user_account/following/{username}" \
 -d '{
  "auto_follow" : false
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String username = username; // String | A valid username
        FollowUserRequest followUserRequest = ; // FollowUserRequest | 

        try {
            UserSummary result = apiInstance.followUser/update(username, followUserRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#followUser/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String username = new String(); // String | A valid username
final FollowUserRequest followUserRequest = new FollowUserRequest(); // FollowUserRequest | 

try {
    final result = await api_instance.followUser/update(username, followUserRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->followUser/update: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String username = username; // String | A valid username
        FollowUserRequest followUserRequest = ; // FollowUserRequest | 

        try {
            UserSummary result = apiInstance.followUser/update(username, followUserRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#followUser/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *username = username; // A valid username (default to null)
FollowUserRequest *followUserRequest = ; // 

// Follow user
[apiInstance followUser/updateWith:username
    followUserRequest:followUserRequest
              completionHandler: ^(UserSummary output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var username = username; // {String} A valid username
var followUserRequest = ; // {FollowUserRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.followUser/update(username, followUserRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class followUser/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var username = username;  // String | A valid username (default to null)
            var followUserRequest = new FollowUserRequest(); // FollowUserRequest | 

            try {
                // Follow user
                UserSummary result = apiInstance.followUser/update(username, followUserRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.followUser/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$username = username; // String | A valid username
$followUserRequest = ; // FollowUserRequest | 

try {
    $result = $api_instance->followUser/update($username, $followUserRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->followUser/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $username = username; # String | A valid username
my $followUserRequest = WWW::OPenAPIClient::Object::FollowUserRequest->new(); # FollowUserRequest | 

eval {
    my $result = $api_instance->followUser/update(username => $username, followUserRequest => $followUserRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->followUser/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
username = username # String | A valid username (default to null)
followUserRequest =  # FollowUserRequest | 

try:
    # Follow user
    api_response = api_instance.follow_user/update(username, followUserRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->followUser/update: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let username = username; // String
    let followUserRequest = ; // FollowUserRequest

    let mut context = UserAccountApi::Context::default();
    let result = client.followUser/update(username, followUserRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:write Update your user accounts and followers

Parameters

Path parameters
Name Description
username*
String
A valid username
Required
Body parameters
Name Description
followUserRequest *

Follow a user.

Responses


followers/list

List followers

Get a list of your followers.


/user_account/followers

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/followers?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            followers_list_200_response result = apiInstance.followers/list(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#followers/list");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.followers/list(bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->followers/list: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            followers_list_200_response result = apiInstance.followers/list(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#followers/list");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// List followers
[apiInstance followers/listWith:bookmark
    pageSize:pageSize
              completionHandler: ^(followers_list_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.followers/list(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class followers/listExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // List followers
                followers_list_200_response result = apiInstance.followers/list(bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.followers/list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->followers/list($bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->followers/list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->followers/list(bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->followers/list: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # List followers
    api_response = api_instance.followers/list(bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->followers/list: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = UserAccountApi::Context::default();
    let result = client.followers/list(bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


linkedBusinessAccounts/get

List linked businesses

Get a list of your linked business accounts.


/user_account/businesses

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/businesses"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();

        try {
            array[LinkedBusiness] result = apiInstance.linkedBusinessAccounts/get();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#linkedBusinessAccounts/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.linkedBusinessAccounts/get();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->linkedBusinessAccounts/get: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();

        try {
            array[LinkedBusiness] result = apiInstance.linkedBusinessAccounts/get();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#linkedBusinessAccounts/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];

// List linked businesses
[apiInstance linkedBusinessAccounts/getWithCompletionHandler: 
              ^(array[LinkedBusiness] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.linkedBusinessAccounts/get(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class linkedBusinessAccounts/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();

            try {
                // List linked businesses
                array[LinkedBusiness] result = apiInstance.linkedBusinessAccounts/get();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.linkedBusinessAccounts/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();

try {
    $result = $api_instance->linkedBusinessAccounts/get();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->linkedBusinessAccounts/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();

eval {
    my $result = $api_instance->linkedBusinessAccounts/get();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->linkedBusinessAccounts/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()

try:
    # List linked businesses
    api_response = api_instance.linked_business_accounts/get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->linkedBusinessAccounts/get: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {

    let mut context = UserAccountApi::Context::default();
    let result = client.linkedBusinessAccounts/get(&context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Responses


unverifyWebsite/delete

Unverify website

Unverifu a website verified by the signed-in user.


/user_account/websites

Usage and SDK Samples

curl -X DELETE \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/websites?website=mysite.test"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String website = mysite.test; // String | Website with path or domain only

        try {
            apiInstance.unverifyWebsite/delete(website);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#unverifyWebsite/delete");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String website = new String(); // String | Website with path or domain only

try {
    final result = await api_instance.unverifyWebsite/delete(website);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->unverifyWebsite/delete: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String website = mysite.test; // String | Website with path or domain only

        try {
            apiInstance.unverifyWebsite/delete(website);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#unverifyWebsite/delete");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *website = mysite.test; // Website with path or domain only (default to null)

// Unverify website
[apiInstance unverifyWebsite/deleteWith:website
              completionHandler: ^(NSError* error) {
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var website = mysite.test; // {String} Website with path or domain only

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.unverifyWebsite/delete(website, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class unverifyWebsite/deleteExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var website = mysite.test;  // String | Website with path or domain only (default to null)

            try {
                // Unverify website
                apiInstance.unverifyWebsite/delete(website);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.unverifyWebsite/delete: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$website = mysite.test; // String | Website with path or domain only

try {
    $api_instance->unverifyWebsite/delete($website);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->unverifyWebsite/delete: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $website = mysite.test; # String | Website with path or domain only

eval {
    $api_instance->unverifyWebsite/delete(website => $website);
};
if ($@) {
    warn "Exception when calling UserAccountApi->unverifyWebsite/delete: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
website = mysite.test # String | Website with path or domain only (default to null)

try:
    # Unverify website
    api_instance.unverify_website/delete(website)
except ApiException as e:
    print("Exception when calling UserAccountApi->unverifyWebsite/delete: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let website = mysite.test; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.unverifyWebsite/delete(website, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:write Update your user accounts and followers

Parameters

Query parameters
Name Description
website*
String
Website with path or domain only
Required

Responses


userAccount/analytics

Get user account analytics

Get analytics for the "operation user_account" - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account".


/user_account/analytics

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/analytics?start_date=2013-10-20&end_date=2013-10-20&from_claimed_content=fromClaimedContent_example&pin_format=pinFormat_example&app_types=appTypes_example&content_type=contentType_example&source=source_example&metric_types=&split_field=splitField_example&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        String fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
        String pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
        String source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
        array[String] metricTypes = ; // array[String] | Metric types to get data for, default is all. 
        String splitField = splitField_example; // String | How to split the data into groups. Not including this param means data won't be split.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            map['String', AnalyticsMetricsResponse] result = apiInstance.userAccount/analytics(startDate, endDate, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, splitField, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/analytics");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final String fromClaimedContent = new String(); // String | Filter on Pins that match your claimed domain.
final String pinFormat = new String(); // String | Pin formats to get data for, default is all.
final String appTypes = new String(); // String | Apps or devices to get data for, default is all.
final String contentType = new String(); // String | Filter to paid or organic data. Default is all.
final String source = new String(); // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
final array[String] metricTypes = new array[String](); // array[String] | Metric types to get data for, default is all. 
final String splitField = new String(); // String | How to split the data into groups. Not including this param means data won't be split.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.userAccount/analytics(startDate, endDate, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, splitField, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userAccount/analytics: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        String fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
        String pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
        String source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
        array[String] metricTypes = ; // array[String] | Metric types to get data for, default is all. 
        String splitField = splitField_example; // String | How to split the data into groups. Not including this param means data won't be split.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            map['String', AnalyticsMetricsResponse] result = apiInstance.userAccount/analytics(startDate, endDate, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, splitField, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/analytics");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
String *fromClaimedContent = fromClaimedContent_example; // Filter on Pins that match your claimed domain. (optional) (default to BOTH)
String *pinFormat = pinFormat_example; // Pin formats to get data for, default is all. (optional) (default to ALL)
String *appTypes = appTypes_example; // Apps or devices to get data for, default is all. (optional) (default to ALL)
String *contentType = contentType_example; // Filter to paid or organic data. Default is all. (optional) (default to ALL)
String *source = source_example; // Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional) (default to ALL)
array[String] *metricTypes = ; // Metric types to get data for, default is all.  (optional) (default to null)
String *splitField = splitField_example; // How to split the data into groups. Not including this param means data won't be split. (optional) (default to NO_SPLIT)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get user account analytics
[apiInstance userAccount/analyticsWith:startDate
    endDate:endDate
    fromClaimedContent:fromClaimedContent
    pinFormat:pinFormat
    appTypes:appTypes
    contentType:contentType
    source:source
    metricTypes:metricTypes
    splitField:splitField
    adAccountId:adAccountId
              completionHandler: ^(map['String', AnalyticsMetricsResponse] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var opts = {
  'fromClaimedContent': fromClaimedContent_example, // {String} Filter on Pins that match your claimed domain.
  'pinFormat': pinFormat_example, // {String} Pin formats to get data for, default is all.
  'appTypes': appTypes_example, // {String} Apps or devices to get data for, default is all.
  'contentType': contentType_example, // {String} Filter to paid or organic data. Default is all.
  'source': source_example, // {String} Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
  'metricTypes': , // {array[String]} Metric types to get data for, default is all. 
  'splitField': splitField_example, // {String} How to split the data into groups. Not including this param means data won't be split.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userAccount/analytics(startDate, endDate, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userAccount/analyticsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var fromClaimedContent = fromClaimedContent_example;  // String | Filter on Pins that match your claimed domain. (optional)  (default to BOTH)
            var pinFormat = pinFormat_example;  // String | Pin formats to get data for, default is all. (optional)  (default to ALL)
            var appTypes = appTypes_example;  // String | Apps or devices to get data for, default is all. (optional)  (default to ALL)
            var contentType = contentType_example;  // String | Filter to paid or organic data. Default is all. (optional)  (default to ALL)
            var source = source_example;  // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional)  (default to ALL)
            var metricTypes = new array[String](); // array[String] | Metric types to get data for, default is all.  (optional)  (default to null)
            var splitField = splitField_example;  // String | How to split the data into groups. Not including this param means data won't be split. (optional)  (default to NO_SPLIT)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get user account analytics
                map['String', AnalyticsMetricsResponse] result = apiInstance.userAccount/analytics(startDate, endDate, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, splitField, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userAccount/analytics: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
$pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
$appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
$contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
$source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
$metricTypes = ; // array[String] | Metric types to get data for, default is all. 
$splitField = splitField_example; // String | How to split the data into groups. Not including this param means data won't be split.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->userAccount/analytics($startDate, $endDate, $fromClaimedContent, $pinFormat, $appTypes, $contentType, $source, $metricTypes, $splitField, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userAccount/analytics: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $fromClaimedContent = fromClaimedContent_example; # String | Filter on Pins that match your claimed domain.
my $pinFormat = pinFormat_example; # String | Pin formats to get data for, default is all.
my $appTypes = appTypes_example; # String | Apps or devices to get data for, default is all.
my $contentType = contentType_example; # String | Filter to paid or organic data. Default is all.
my $source = source_example; # String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
my $metricTypes = []; # array[String] | Metric types to get data for, default is all. 
my $splitField = splitField_example; # String | How to split the data into groups. Not including this param means data won't be split.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->userAccount/analytics(startDate => $startDate, endDate => $endDate, fromClaimedContent => $fromClaimedContent, pinFormat => $pinFormat, appTypes => $appTypes, contentType => $contentType, source => $source, metricTypes => $metricTypes, splitField => $splitField, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userAccount/analytics: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
fromClaimedContent = fromClaimedContent_example # String | Filter on Pins that match your claimed domain. (optional) (default to BOTH)
pinFormat = pinFormat_example # String | Pin formats to get data for, default is all. (optional) (default to ALL)
appTypes = appTypes_example # String | Apps or devices to get data for, default is all. (optional) (default to ALL)
contentType = contentType_example # String | Filter to paid or organic data. Default is all. (optional) (default to ALL)
source = source_example # String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional) (default to ALL)
metricTypes =  # array[String] | Metric types to get data for, default is all.  (optional) (default to null)
splitField = splitField_example # String | How to split the data into groups. Not including this param means data won't be split. (optional) (default to NO_SPLIT)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get user account analytics
    api_response = api_instance.user_account/analytics(startDate, endDate, fromClaimedContent=fromClaimedContent, pinFormat=pinFormat, appTypes=appTypes, contentType=contentType, source=source, metricTypes=metricTypes, splitField=splitField, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userAccount/analytics: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let fromClaimedContent = fromClaimedContent_example; // String
    let pinFormat = pinFormat_example; // String
    let appTypes = appTypes_example; // String
    let contentType = contentType_example; // String
    let source = source_example; // String
    let metricTypes = ; // array[String]
    let splitField = splitField_example; // String
    let adAccountId = adAccountId_example; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.userAccount/analytics(startDate, endDate, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, splitField, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
from_claimed_content
String
Filter on Pins that match your claimed domain.
pin_format
String
Pin formats to get data for, default is all.
app_types
String
Apps or devices to get data for, default is all.
content_type
String
Filter to paid or organic data. Default is all.
source
String
Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
metric_types
array[String]
Metric types to get data for, default is all.
split_field
String
How to split the data into groups. Not including this param means data won't be split.
ad_account_id
String
Unique identifier of an ad account.

Responses


userAccount/analytics/topPins

Get user account top pins analytics

Gets analytics data about a user's top pins (limited to the top 50). - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account".


/user_account/analytics/top_pins

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/analytics/top_pins?start_date=2013-10-20&end_date=2013-10-20&sort_by=sortBy_example&from_claimed_content=fromClaimedContent_example&pin_format=pinFormat_example&app_types=appTypes_example&content_type=contentType_example&source=source_example&metric_types=&num_of_pins=25&created_in_last_n_days=30&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        String sortBy = sortBy_example; // String | Specify sorting order for metrics
        String fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
        String pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
        String source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
        array[String] metricTypes = ; // array[String] | Metric types to get data for, default is all. 
        Integer numOfPins = 25; // Integer | Number of pins to include, default is 10. Max is 50.
        Integer createdInLastNDays = 30; // Integer | Get metrics for pins created in the last "n" days.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            TopPinsAnalyticsResponse result = apiInstance.userAccount/analytics/topPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/analytics/topPins");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final String sortBy = new String(); // String | Specify sorting order for metrics
final String fromClaimedContent = new String(); // String | Filter on Pins that match your claimed domain.
final String pinFormat = new String(); // String | Pin formats to get data for, default is all.
final String appTypes = new String(); // String | Apps or devices to get data for, default is all.
final String contentType = new String(); // String | Filter to paid or organic data. Default is all.
final String source = new String(); // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
final array[String] metricTypes = new array[String](); // array[String] | Metric types to get data for, default is all. 
final Integer numOfPins = new Integer(); // Integer | Number of pins to include, default is 10. Max is 50.
final Integer createdInLastNDays = new Integer(); // Integer | Get metrics for pins created in the last "n" days.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.userAccount/analytics/topPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userAccount/analytics/topPins: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        String sortBy = sortBy_example; // String | Specify sorting order for metrics
        String fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
        String pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
        String source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
        array[String] metricTypes = ; // array[String] | Metric types to get data for, default is all. 
        Integer numOfPins = 25; // Integer | Number of pins to include, default is 10. Max is 50.
        Integer createdInLastNDays = 30; // Integer | Get metrics for pins created in the last "n" days.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            TopPinsAnalyticsResponse result = apiInstance.userAccount/analytics/topPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/analytics/topPins");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
String *sortBy = sortBy_example; // Specify sorting order for metrics (default to null)
String *fromClaimedContent = fromClaimedContent_example; // Filter on Pins that match your claimed domain. (optional) (default to BOTH)
String *pinFormat = pinFormat_example; // Pin formats to get data for, default is all. (optional) (default to ALL)
String *appTypes = appTypes_example; // Apps or devices to get data for, default is all. (optional) (default to ALL)
String *contentType = contentType_example; // Filter to paid or organic data. Default is all. (optional) (default to ALL)
String *source = source_example; // Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional) (default to ALL)
array[String] *metricTypes = ; // Metric types to get data for, default is all.  (optional) (default to null)
Integer *numOfPins = 25; // Number of pins to include, default is 10. Max is 50. (optional) (default to 10)
Integer *createdInLastNDays = 30; // Get metrics for pins created in the last "n" days. (optional) (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get user account top pins analytics
[apiInstance userAccount/analytics/topPinsWith:startDate
    endDate:endDate
    sortBy:sortBy
    fromClaimedContent:fromClaimedContent
    pinFormat:pinFormat
    appTypes:appTypes
    contentType:contentType
    source:source
    metricTypes:metricTypes
    numOfPins:numOfPins
    createdInLastNDays:createdInLastNDays
    adAccountId:adAccountId
              completionHandler: ^(TopPinsAnalyticsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var sortBy = sortBy_example; // {String} Specify sorting order for metrics
var opts = {
  'fromClaimedContent': fromClaimedContent_example, // {String} Filter on Pins that match your claimed domain.
  'pinFormat': pinFormat_example, // {String} Pin formats to get data for, default is all.
  'appTypes': appTypes_example, // {String} Apps or devices to get data for, default is all.
  'contentType': contentType_example, // {String} Filter to paid or organic data. Default is all.
  'source': source_example, // {String} Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
  'metricTypes': , // {array[String]} Metric types to get data for, default is all. 
  'numOfPins': 25, // {Integer} Number of pins to include, default is 10. Max is 50.
  'createdInLastNDays': 30, // {Integer} Get metrics for pins created in the last "n" days.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userAccount/analytics/topPins(startDate, endDate, sortBy, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userAccount/analytics/topPinsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var sortBy = sortBy_example;  // String | Specify sorting order for metrics (default to null)
            var fromClaimedContent = fromClaimedContent_example;  // String | Filter on Pins that match your claimed domain. (optional)  (default to BOTH)
            var pinFormat = pinFormat_example;  // String | Pin formats to get data for, default is all. (optional)  (default to ALL)
            var appTypes = appTypes_example;  // String | Apps or devices to get data for, default is all. (optional)  (default to ALL)
            var contentType = contentType_example;  // String | Filter to paid or organic data. Default is all. (optional)  (default to ALL)
            var source = source_example;  // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional)  (default to ALL)
            var metricTypes = new array[String](); // array[String] | Metric types to get data for, default is all.  (optional)  (default to null)
            var numOfPins = 25;  // Integer | Number of pins to include, default is 10. Max is 50. (optional)  (default to 10)
            var createdInLastNDays = 30;  // Integer | Get metrics for pins created in the last "n" days. (optional)  (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get user account top pins analytics
                TopPinsAnalyticsResponse result = apiInstance.userAccount/analytics/topPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userAccount/analytics/topPins: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$sortBy = sortBy_example; // String | Specify sorting order for metrics
$fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
$pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
$appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
$contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
$source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
$metricTypes = ; // array[String] | Metric types to get data for, default is all. 
$numOfPins = 25; // Integer | Number of pins to include, default is 10. Max is 50.
$createdInLastNDays = 30; // Integer | Get metrics for pins created in the last "n" days.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->userAccount/analytics/topPins($startDate, $endDate, $sortBy, $fromClaimedContent, $pinFormat, $appTypes, $contentType, $source, $metricTypes, $numOfPins, $createdInLastNDays, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userAccount/analytics/topPins: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $sortBy = sortBy_example; # String | Specify sorting order for metrics
my $fromClaimedContent = fromClaimedContent_example; # String | Filter on Pins that match your claimed domain.
my $pinFormat = pinFormat_example; # String | Pin formats to get data for, default is all.
my $appTypes = appTypes_example; # String | Apps or devices to get data for, default is all.
my $contentType = contentType_example; # String | Filter to paid or organic data. Default is all.
my $source = source_example; # String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
my $metricTypes = []; # array[String] | Metric types to get data for, default is all. 
my $numOfPins = 25; # Integer | Number of pins to include, default is 10. Max is 50.
my $createdInLastNDays = 30; # Integer | Get metrics for pins created in the last "n" days.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->userAccount/analytics/topPins(startDate => $startDate, endDate => $endDate, sortBy => $sortBy, fromClaimedContent => $fromClaimedContent, pinFormat => $pinFormat, appTypes => $appTypes, contentType => $contentType, source => $source, metricTypes => $metricTypes, numOfPins => $numOfPins, createdInLastNDays => $createdInLastNDays, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userAccount/analytics/topPins: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
sortBy = sortBy_example # String | Specify sorting order for metrics (default to null)
fromClaimedContent = fromClaimedContent_example # String | Filter on Pins that match your claimed domain. (optional) (default to BOTH)
pinFormat = pinFormat_example # String | Pin formats to get data for, default is all. (optional) (default to ALL)
appTypes = appTypes_example # String | Apps or devices to get data for, default is all. (optional) (default to ALL)
contentType = contentType_example # String | Filter to paid or organic data. Default is all. (optional) (default to ALL)
source = source_example # String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional) (default to ALL)
metricTypes =  # array[String] | Metric types to get data for, default is all.  (optional) (default to null)
numOfPins = 25 # Integer | Number of pins to include, default is 10. Max is 50. (optional) (default to 10)
createdInLastNDays = 30 # Integer | Get metrics for pins created in the last "n" days. (optional) (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get user account top pins analytics
    api_response = api_instance.user_account/analytics/top_pins(startDate, endDate, sortBy, fromClaimedContent=fromClaimedContent, pinFormat=pinFormat, appTypes=appTypes, contentType=contentType, source=source, metricTypes=metricTypes, numOfPins=numOfPins, createdInLastNDays=createdInLastNDays, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userAccount/analytics/topPins: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let sortBy = sortBy_example; // String
    let fromClaimedContent = fromClaimedContent_example; // String
    let pinFormat = pinFormat_example; // String
    let appTypes = appTypes_example; // String
    let contentType = contentType_example; // String
    let source = source_example; // String
    let metricTypes = ; // array[String]
    let numOfPins = 25; // Integer
    let createdInLastNDays = 30; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.userAccount/analytics/topPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

pins:read See your public Pins
user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
sort_by*
String
Specify sorting order for metrics
Required
from_claimed_content
String
Filter on Pins that match your claimed domain.
pin_format
String
Pin formats to get data for, default is all.
app_types
String
Apps or devices to get data for, default is all.
content_type
String
Filter to paid or organic data. Default is all.
source
String
Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
metric_types
array[String]
Metric types to get data for, default is all.
num_of_pins
Integer
Number of pins to include, default is 10. Max is 50.
created_in_last_n_days
Integer
Get metrics for pins created in the last "n" days.
ad_account_id
String
Unique identifier of an ad account.

Responses


userAccount/analytics/topVideoPins

Get user account top video pins analytics

Gets analytics data about a user's top video pins (limited to the top 50). - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account".


/user_account/analytics/top_video_pins

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/analytics/top_video_pins?start_date=2013-10-20&end_date=2013-10-20&sort_by=sortBy_example&from_claimed_content=fromClaimedContent_example&pin_format=pinFormat_example&app_types=appTypes_example&content_type=contentType_example&source=source_example&metric_types=&num_of_pins=25&created_in_last_n_days=30&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        String sortBy = sortBy_example; // String | Specify sorting order for video metrics
        String fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
        String pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
        String source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
        array[String] metricTypes = ; // array[String] | Metric types to get video data for, default is all. 
        Integer numOfPins = 25; // Integer | Number of pins to include, default is 10. Max is 50.
        Integer createdInLastNDays = 30; // Integer | Get metrics for pins created in the last "n" days.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            TopVideoPinsAnalyticsResponse result = apiInstance.userAccount/analytics/topVideoPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/analytics/topVideoPins");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final date startDate = new date(); // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
final date endDate = new date(); // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
final String sortBy = new String(); // String | Specify sorting order for video metrics
final String fromClaimedContent = new String(); // String | Filter on Pins that match your claimed domain.
final String pinFormat = new String(); // String | Pin formats to get data for, default is all.
final String appTypes = new String(); // String | Apps or devices to get data for, default is all.
final String contentType = new String(); // String | Filter to paid or organic data. Default is all.
final String source = new String(); // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
final array[String] metricTypes = new array[String](); // array[String] | Metric types to get video data for, default is all. 
final Integer numOfPins = new Integer(); // Integer | Number of pins to include, default is 10. Max is 50.
final Integer createdInLastNDays = new Integer(); // Integer | Get metrics for pins created in the last "n" days.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.userAccount/analytics/topVideoPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userAccount/analytics/topVideoPins: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        date startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
        date endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
        String sortBy = sortBy_example; // String | Specify sorting order for video metrics
        String fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
        String pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
        String appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
        String contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
        String source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
        array[String] metricTypes = ; // array[String] | Metric types to get video data for, default is all. 
        Integer numOfPins = 25; // Integer | Number of pins to include, default is 10. Max is 50.
        Integer createdInLastNDays = 30; // Integer | Get metrics for pins created in the last "n" days.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            TopVideoPinsAnalyticsResponse result = apiInstance.userAccount/analytics/topVideoPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/analytics/topVideoPins");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
date *startDate = 2013-10-20; // Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
date *endDate = 2013-10-20; // Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
String *sortBy = sortBy_example; // Specify sorting order for video metrics (default to null)
String *fromClaimedContent = fromClaimedContent_example; // Filter on Pins that match your claimed domain. (optional) (default to BOTH)
String *pinFormat = pinFormat_example; // Pin formats to get data for, default is all. (optional) (default to ALL)
String *appTypes = appTypes_example; // Apps or devices to get data for, default is all. (optional) (default to ALL)
String *contentType = contentType_example; // Filter to paid or organic data. Default is all. (optional) (default to ALL)
String *source = source_example; // Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional) (default to ALL)
array[String] *metricTypes = ; // Metric types to get video data for, default is all.  (optional) (default to null)
Integer *numOfPins = 25; // Number of pins to include, default is 10. Max is 50. (optional) (default to 10)
Integer *createdInLastNDays = 30; // Get metrics for pins created in the last "n" days. (optional) (default to null)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get user account top video pins analytics
[apiInstance userAccount/analytics/topVideoPinsWith:startDate
    endDate:endDate
    sortBy:sortBy
    fromClaimedContent:fromClaimedContent
    pinFormat:pinFormat
    appTypes:appTypes
    contentType:contentType
    source:source
    metricTypes:metricTypes
    numOfPins:numOfPins
    createdInLastNDays:createdInLastNDays
    adAccountId:adAccountId
              completionHandler: ^(TopVideoPinsAnalyticsResponse output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var startDate = 2013-10-20; // {date} Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
var endDate = 2013-10-20; // {date} Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
var sortBy = sortBy_example; // {String} Specify sorting order for video metrics
var opts = {
  'fromClaimedContent': fromClaimedContent_example, // {String} Filter on Pins that match your claimed domain.
  'pinFormat': pinFormat_example, // {String} Pin formats to get data for, default is all.
  'appTypes': appTypes_example, // {String} Apps or devices to get data for, default is all.
  'contentType': contentType_example, // {String} Filter to paid or organic data. Default is all.
  'source': source_example, // {String} Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
  'metricTypes': , // {array[String]} Metric types to get video data for, default is all. 
  'numOfPins': 25, // {Integer} Number of pins to include, default is 10. Max is 50.
  'createdInLastNDays': 30, // {Integer} Get metrics for pins created in the last "n" days.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userAccount/analytics/topVideoPins(startDate, endDate, sortBy, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userAccount/analytics/topVideoPinsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var startDate = 2013-10-20;  // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
            var endDate = 2013-10-20;  // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
            var sortBy = sortBy_example;  // String | Specify sorting order for video metrics (default to null)
            var fromClaimedContent = fromClaimedContent_example;  // String | Filter on Pins that match your claimed domain. (optional)  (default to BOTH)
            var pinFormat = pinFormat_example;  // String | Pin formats to get data for, default is all. (optional)  (default to ALL)
            var appTypes = appTypes_example;  // String | Apps or devices to get data for, default is all. (optional)  (default to ALL)
            var contentType = contentType_example;  // String | Filter to paid or organic data. Default is all. (optional)  (default to ALL)
            var source = source_example;  // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional)  (default to ALL)
            var metricTypes = new array[String](); // array[String] | Metric types to get video data for, default is all.  (optional)  (default to null)
            var numOfPins = 25;  // Integer | Number of pins to include, default is 10. Max is 50. (optional)  (default to 10)
            var createdInLastNDays = 30;  // Integer | Get metrics for pins created in the last "n" days. (optional)  (default to null)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get user account top video pins analytics
                TopVideoPinsAnalyticsResponse result = apiInstance.userAccount/analytics/topVideoPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userAccount/analytics/topVideoPins: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$startDate = 2013-10-20; // date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
$endDate = 2013-10-20; // date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
$sortBy = sortBy_example; // String | Specify sorting order for video metrics
$fromClaimedContent = fromClaimedContent_example; // String | Filter on Pins that match your claimed domain.
$pinFormat = pinFormat_example; // String | Pin formats to get data for, default is all.
$appTypes = appTypes_example; // String | Apps or devices to get data for, default is all.
$contentType = contentType_example; // String | Filter to paid or organic data. Default is all.
$source = source_example; // String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
$metricTypes = ; // array[String] | Metric types to get video data for, default is all. 
$numOfPins = 25; // Integer | Number of pins to include, default is 10. Max is 50.
$createdInLastNDays = 30; // Integer | Get metrics for pins created in the last "n" days.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->userAccount/analytics/topVideoPins($startDate, $endDate, $sortBy, $fromClaimedContent, $pinFormat, $appTypes, $contentType, $source, $metricTypes, $numOfPins, $createdInLastNDays, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userAccount/analytics/topVideoPins: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $startDate = 2013-10-20; # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
my $endDate = 2013-10-20; # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
my $sortBy = sortBy_example; # String | Specify sorting order for video metrics
my $fromClaimedContent = fromClaimedContent_example; # String | Filter on Pins that match your claimed domain.
my $pinFormat = pinFormat_example; # String | Pin formats to get data for, default is all.
my $appTypes = appTypes_example; # String | Apps or devices to get data for, default is all.
my $contentType = contentType_example; # String | Filter to paid or organic data. Default is all.
my $source = source_example; # String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
my $metricTypes = []; # array[String] | Metric types to get video data for, default is all. 
my $numOfPins = 25; # Integer | Number of pins to include, default is 10. Max is 50.
my $createdInLastNDays = 30; # Integer | Get metrics for pins created in the last "n" days.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->userAccount/analytics/topVideoPins(startDate => $startDate, endDate => $endDate, sortBy => $sortBy, fromClaimedContent => $fromClaimedContent, pinFormat => $pinFormat, appTypes => $appTypes, contentType => $contentType, source => $source, metricTypes => $metricTypes, numOfPins => $numOfPins, createdInLastNDays => $createdInLastNDays, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userAccount/analytics/topVideoPins: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
startDate = 2013-10-20 # date | Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today. (default to null)
endDate = 2013-10-20 # date | Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date. (default to null)
sortBy = sortBy_example # String | Specify sorting order for video metrics (default to null)
fromClaimedContent = fromClaimedContent_example # String | Filter on Pins that match your claimed domain. (optional) (default to BOTH)
pinFormat = pinFormat_example # String | Pin formats to get data for, default is all. (optional) (default to ALL)
appTypes = appTypes_example # String | Apps or devices to get data for, default is all. (optional) (default to ALL)
contentType = contentType_example # String | Filter to paid or organic data. Default is all. (optional) (default to ALL)
source = source_example # String | Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts (optional) (default to ALL)
metricTypes =  # array[String] | Metric types to get video data for, default is all.  (optional) (default to null)
numOfPins = 25 # Integer | Number of pins to include, default is 10. Max is 50. (optional) (default to 10)
createdInLastNDays = 30 # Integer | Get metrics for pins created in the last "n" days. (optional) (default to null)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get user account top video pins analytics
    api_response = api_instance.user_account/analytics/top_video_pins(startDate, endDate, sortBy, fromClaimedContent=fromClaimedContent, pinFormat=pinFormat, appTypes=appTypes, contentType=contentType, source=source, metricTypes=metricTypes, numOfPins=numOfPins, createdInLastNDays=createdInLastNDays, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userAccount/analytics/topVideoPins: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let startDate = 2013-10-20; // date
    let endDate = 2013-10-20; // date
    let sortBy = sortBy_example; // String
    let fromClaimedContent = fromClaimedContent_example; // String
    let pinFormat = pinFormat_example; // String
    let appTypes = appTypes_example; // String
    let contentType = contentType_example; // String
    let source = source_example; // String
    let metricTypes = ; // array[String]
    let numOfPins = 25; // Integer
    let createdInLastNDays = 30; // Integer
    let adAccountId = adAccountId_example; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.userAccount/analytics/topVideoPins(startDate, endDate, sortBy, fromClaimedContent, pinFormat, appTypes, contentType, source, metricTypes, numOfPins, createdInLastNDays, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

pins:read See your public Pins
user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
start_date*
date (date)
Metric report start date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days back from today.
Required
end_date*
date (date)
Metric report end date (UTC). Format: YYYY-MM-DD. Cannot be more than 90 days past start_date.
Required
sort_by*
String
Specify sorting order for video metrics
Required
from_claimed_content
String
Filter on Pins that match your claimed domain.
pin_format
String
Pin formats to get data for, default is all.
app_types
String
Apps or devices to get data for, default is all.
content_type
String
Filter to paid or organic data. Default is all.
source
String
Filter to activity from Pins created and saved by your, or activity created and saved by others from your claimed accounts
metric_types
array[String]
Metric types to get video data for, default is all.
num_of_pins
Integer
Number of pins to include, default is 10. Max is 50.
created_in_last_n_days
Integer
Get metrics for pins created in the last "n" days.
ad_account_id
String
Unique identifier of an ad account.

Responses


userAccount/followedInterests

List following interests

Get a list of a user's following interests in one place.


/users/{username}/interests/follow

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/users/{username}/interests/follow?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String username = username; // String | A valid username
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            user_account_followed_interests_200_response result = apiInstance.userAccount/followedInterests(username, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/followedInterests");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String username = new String(); // String | A valid username
final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.userAccount/followedInterests(username, bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userAccount/followedInterests: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String username = username; // String | A valid username
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            user_account_followed_interests_200_response result = apiInstance.userAccount/followedInterests(username, bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/followedInterests");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *username = username; // A valid username (default to null)
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// List following interests
[apiInstance userAccount/followedInterestsWith:username
    bookmark:bookmark
    pageSize:pageSize
              completionHandler: ^(user_account_followed_interests_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var username = username; // {String} A valid username
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userAccount/followedInterests(username, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userAccount/followedInterestsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var username = username;  // String | A valid username (default to null)
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // List following interests
                user_account_followed_interests_200_response result = apiInstance.userAccount/followedInterests(username, bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userAccount/followedInterests: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$username = username; // String | A valid username
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->userAccount/followedInterests($username, $bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userAccount/followedInterests: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $username = username; # String | A valid username
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->userAccount/followedInterests(username => $username, bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userAccount/followedInterests: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
username = username # String | A valid username (default to null)
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # List following interests
    api_response = api_instance.user_account/followed_interests(username, bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userAccount/followedInterests: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let username = username; // String
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = UserAccountApi::Context::default();
    let result = client.userAccount/followedInterests(username, bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Path parameters
Name Description
username*
String
A valid username
Required
Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


userAccount/get

Get user account

Get account information for the "operation user_account" - By default, the "operation user_account" is the token user_account. If using Business Access: Specify an ad_account_id to use the owner of that ad_account as the "operation user_account". See <a href='/docs/reference/business-access/'>Understanding Business Access</a> for more information.


/user_account

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account?ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Account result = apiInstance.userAccount/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.userAccount/get(adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userAccount/get: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            Account result = apiInstance.userAccount/get(adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userAccount/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// Get user account
[apiInstance userAccount/getWith:adAccountId
              completionHandler: ^(Account output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var opts = {
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userAccount/get(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userAccount/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // Get user account
                Account result = apiInstance.userAccount/get(adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userAccount/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->userAccount/get($adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userAccount/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->userAccount/get(adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userAccount/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # Get user account
    api_response = api_instance.user_account/get(adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userAccount/get: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let adAccountId = adAccountId_example; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.userAccount/get(adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
ad_account_id
String
Unique identifier of an ad account.

Responses


userFollowing/get

List following

Get a list of who a certain user follows.


/user_account/following

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/following?bookmark=bookmark_example&page_size=56&feed_type=feedType_example&explicit_following=true&ad_account_id=adAccountId_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        UserFollowingFeedType feedType = feedType_example; // UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees.
        Boolean explicitFollowing = true; // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            user_following_get_200_response result = apiInstance.userFollowing/get(bookmark, pageSize, feedType, explicitFollowing, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userFollowing/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
final UserFollowingFeedType feedType = new UserFollowingFeedType(); // UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees.
final Boolean explicitFollowing = new Boolean(); // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
final String adAccountId = new String(); // String | Unique identifier of an ad account.

try {
    final result = await api_instance.userFollowing/get(bookmark, pageSize, feedType, explicitFollowing, adAccountId);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userFollowing/get: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
        UserFollowingFeedType feedType = feedType_example; // UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees.
        Boolean explicitFollowing = true; // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
        String adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

        try {
            user_following_get_200_response result = apiInstance.userFollowing/get(bookmark, pageSize, feedType, explicitFollowing, adAccountId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userFollowing/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
UserFollowingFeedType *feedType = feedType_example; // Thrift param specifying what type of followees will be kept. Default to include all followees. (optional) (default to null)
Boolean *explicitFollowing = true; // Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows. (optional) (default to false)
String *adAccountId = adAccountId_example; // Unique identifier of an ad account. (optional) (default to null)

// List following
[apiInstance userFollowing/getWith:bookmark
    pageSize:pageSize
    feedType:feedType
    explicitFollowing:explicitFollowing
    adAccountId:adAccountId
              completionHandler: ^(user_following_get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56, // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
  'feedType': feedType_example, // {UserFollowingFeedType} Thrift param specifying what type of followees will be kept. Default to include all followees.
  'explicitFollowing': true, // {Boolean} Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
  'adAccountId': adAccountId_example // {String} Unique identifier of an ad account.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userFollowing/get(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userFollowing/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)
            var feedType = feedType_example;  // UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees. (optional)  (default to null)
            var explicitFollowing = true;  // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows. (optional)  (default to false)
            var adAccountId = adAccountId_example;  // String | Unique identifier of an ad account. (optional)  (default to null)

            try {
                // List following
                user_following_get_200_response result = apiInstance.userFollowing/get(bookmark, pageSize, feedType, explicitFollowing, adAccountId);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userFollowing/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
$feedType = feedType_example; // UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees.
$explicitFollowing = true; // Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
$adAccountId = adAccountId_example; // String | Unique identifier of an ad account.

try {
    $result = $api_instance->userFollowing/get($bookmark, $pageSize, $feedType, $explicitFollowing, $adAccountId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userFollowing/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
my $feedType = feedType_example; # UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees.
my $explicitFollowing = true; # Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
my $adAccountId = adAccountId_example; # String | Unique identifier of an ad account.

eval {
    my $result = $api_instance->userFollowing/get(bookmark => $bookmark, pageSize => $pageSize, feedType => $feedType, explicitFollowing => $explicitFollowing, adAccountId => $adAccountId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userFollowing/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)
feedType = feedType_example # UserFollowingFeedType | Thrift param specifying what type of followees will be kept. Default to include all followees. (optional) (default to null)
explicitFollowing = true # Boolean | Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows. (optional) (default to false)
adAccountId = adAccountId_example # String | Unique identifier of an ad account. (optional) (default to null)

try:
    # List following
    api_response = api_instance.user_following/get(bookmark=bookmark, pageSize=pageSize, feedType=feedType, explicitFollowing=explicitFollowing, adAccountId=adAccountId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userFollowing/get: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer
    let feedType = feedType_example; // UserFollowingFeedType
    let explicitFollowing = true; // Boolean
    let adAccountId = adAccountId_example; // String

    let mut context = UserAccountApi::Context::default();
    let result = client.userFollowing/get(bookmark, pageSize, feedType, explicitFollowing, adAccountId, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.
feed_type
UserFollowingFeedType
Thrift param specifying what type of followees will be kept. Default to include all followees.
explicit_following
Boolean
Whether or not to include implicit user follows, which means followees with board follows. When explicit_following is True, it means we only want explicit user follows.
ad_account_id
String
Unique identifier of an ad account.

Responses


userWebsites/get

Get user websites

Get user websites, claimed or not


/user_account/websites

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/websites?bookmark=bookmark_example&page_size=56"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            user_websites_get_200_response result = apiInstance.userWebsites/get(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userWebsites/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String bookmark = new String(); // String | Cursor used to fetch the next page of items
final Integer pageSize = new Integer(); // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    final result = await api_instance.userWebsites/get(bookmark, pageSize);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->userWebsites/get: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        String bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
        Integer pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

        try {
            user_websites_get_200_response result = apiInstance.userWebsites/get(bookmark, pageSize);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#userWebsites/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
String *bookmark = bookmark_example; // Cursor used to fetch the next page of items (optional) (default to null)
Integer *pageSize = 56; // Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

// Get user websites
[apiInstance userWebsites/getWith:bookmark
    pageSize:pageSize
              completionHandler: ^(user_websites_get_200_response output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var opts = {
  'bookmark': bookmark_example, // {String} Cursor used to fetch the next page of items
  'pageSize': 56 // {Integer} Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userWebsites/get(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class userWebsites/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var bookmark = bookmark_example;  // String | Cursor used to fetch the next page of items (optional)  (default to null)
            var pageSize = 56;  // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional)  (default to 25)

            try {
                // Get user websites
                user_websites_get_200_response result = apiInstance.userWebsites/get(bookmark, pageSize);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.userWebsites/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$bookmark = bookmark_example; // String | Cursor used to fetch the next page of items
$pageSize = 56; // Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

try {
    $result = $api_instance->userWebsites/get($bookmark, $pageSize);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->userWebsites/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $bookmark = bookmark_example; # String | Cursor used to fetch the next page of items
my $pageSize = 56; # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information.

eval {
    my $result = $api_instance->userWebsites/get(bookmark => $bookmark, pageSize => $pageSize);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->userWebsites/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
bookmark = bookmark_example # String | Cursor used to fetch the next page of items (optional) (default to null)
pageSize = 56 # Integer | Maximum number of items to include in a single page of the response. See documentation on Pagination for more information. (optional) (default to 25)

try:
    # Get user websites
    api_response = api_instance.user_websites/get(bookmark=bookmark, pageSize=pageSize)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->userWebsites/get: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let bookmark = bookmark_example; // String
    let pageSize = 56; // Integer

    let mut context = UserAccountApi::Context::default();
    let result = client.userWebsites/get(bookmark, pageSize, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Query parameters
Name Description
bookmark
String
Cursor used to fetch the next page of items
page_size
Integer
Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.

Responses


verifyWebsite/update

Verify website

Verify a website as a signed-in user.


/user_account/websites

Usage and SDK Samples

curl -X POST \
 \
 -H "Accept: application/json" \
 -H "Content-Type: application/json" \
 "https://api.pinterest.com/v5/user_account/websites" \
 -d '{
  "website" : "pintest-website-12345678.test/test_1",
  "verification_method" : "METATAG"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();
        UserWebsiteVerifyRequest userWebsiteVerifyRequest = ; // UserWebsiteVerifyRequest | 

        try {
            UserWebsiteSummary result = apiInstance.verifyWebsite/update(userWebsiteVerifyRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#verifyWebsite/update");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final UserWebsiteVerifyRequest userWebsiteVerifyRequest = new UserWebsiteVerifyRequest(); // UserWebsiteVerifyRequest | 

try {
    final result = await api_instance.verifyWebsite/update(userWebsiteVerifyRequest);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->verifyWebsite/update: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();
        UserWebsiteVerifyRequest userWebsiteVerifyRequest = ; // UserWebsiteVerifyRequest | 

        try {
            UserWebsiteSummary result = apiInstance.verifyWebsite/update(userWebsiteVerifyRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#verifyWebsite/update");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];
UserWebsiteVerifyRequest *userWebsiteVerifyRequest = ; // 

// Verify website
[apiInstance verifyWebsite/updateWith:userWebsiteVerifyRequest
              completionHandler: ^(UserWebsiteSummary output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var userWebsiteVerifyRequest = ; // {UserWebsiteVerifyRequest} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.verifyWebsite/update(userWebsiteVerifyRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class verifyWebsite/updateExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();
            var userWebsiteVerifyRequest = new UserWebsiteVerifyRequest(); // UserWebsiteVerifyRequest | 

            try {
                // Verify website
                UserWebsiteSummary result = apiInstance.verifyWebsite/update(userWebsiteVerifyRequest);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.verifyWebsite/update: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();
$userWebsiteVerifyRequest = ; // UserWebsiteVerifyRequest | 

try {
    $result = $api_instance->verifyWebsite/update($userWebsiteVerifyRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->verifyWebsite/update: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();
my $userWebsiteVerifyRequest = WWW::OPenAPIClient::Object::UserWebsiteVerifyRequest->new(); # UserWebsiteVerifyRequest | 

eval {
    my $result = $api_instance->verifyWebsite/update(userWebsiteVerifyRequest => $userWebsiteVerifyRequest);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->verifyWebsite/update: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()
userWebsiteVerifyRequest =  # UserWebsiteVerifyRequest | 

try:
    # Verify website
    api_response = api_instance.verify_website/update(userWebsiteVerifyRequest)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->verifyWebsite/update: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {
    let userWebsiteVerifyRequest = ; // UserWebsiteVerifyRequest

    let mut context = UserAccountApi::Context::default();
    let result = client.verifyWebsite/update(userWebsiteVerifyRequest, &context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:write Update your user accounts and followers

Parameters

Body parameters
Name Description
userWebsiteVerifyRequest *

Verify a website.

Responses


websiteVerification/get

Get user verification code for website claiming

Get verification code for user to install on the website to claim it.


/user_account/websites/verification

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://api.pinterest.com/v5/user_account/websites/verification"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.UserAccountApi;

import java.io.File;
import java.util.*;

public class UserAccountApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: pinterest_oauth2
        OAuth pinterest_oauth2 = (OAuth) defaultClient.getAuthentication("pinterest_oauth2");
        pinterest_oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        UserAccountApi apiInstance = new UserAccountApi();

        try {
            UserWebsiteVerificationCode result = apiInstance.websiteVerification/get();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#websiteVerification/get");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.websiteVerification/get();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->websiteVerification/get: $e\n');
}

import org.openapitools.client.api.UserAccountApi;

public class UserAccountApiExample {
    public static void main(String[] args) {
        UserAccountApi apiInstance = new UserAccountApi();

        try {
            UserWebsiteVerificationCode result = apiInstance.websiteVerification/get();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling UserAccountApi#websiteVerification/get");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: pinterest_oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
UserAccountApi *apiInstance = [[UserAccountApi alloc] init];

// Get user verification code for website claiming
[apiInstance websiteVerification/getWithCompletionHandler: 
              ^(UserWebsiteVerificationCode output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PinterestRestApi = require('pinterest_rest_api');
var defaultClient = PinterestRestApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: pinterest_oauth2
var pinterest_oauth2 = defaultClient.authentications['pinterest_oauth2'];
pinterest_oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PinterestRestApi.UserAccountApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.websiteVerification/get(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class websiteVerification/getExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: pinterest_oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new UserAccountApi();

            try {
                // Get user verification code for website claiming
                UserWebsiteVerificationCode result = apiInstance.websiteVerification/get();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling UserAccountApi.websiteVerification/get: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: pinterest_oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\UserAccountApi();

try {
    $result = $api_instance->websiteVerification/get();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserAccountApi->websiteVerification/get: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::UserAccountApi;

# Configure OAuth2 access token for authorization: pinterest_oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::UserAccountApi->new();

eval {
    my $result = $api_instance->websiteVerification/get();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling UserAccountApi->websiteVerification/get: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: pinterest_oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.UserAccountApi()

try:
    # Get user verification code for website claiming
    api_response = api_instance.website_verification/get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserAccountApi->websiteVerification/get: %s\n" % e)
extern crate UserAccountApi;

pub fn main() {

    let mut context = UserAccountApi::Context::default();
    let result = client.websiteVerification/get(&context).wait();

    println!("{:?}", result);
}

Scopes

user_accounts:read See your user accounts and followers

Parameters

Responses